package .dao.ibatis;
import java.util.List;
import .dao.ibatis.BaseDaoiBATIS;
import .;
import .dao.Dao;
import org.springframework.orm.ObjectRetrievalFailureException;
public class DaoiBatis extends BaseDaoiBATIS implements Dao {
/**
* @see .dao.Dao#gets(.)
*/
public List gets(final ) {
return getSqlMapClientTemplate().queryForList("gets", null);
}
/**
* @see .dao.Dao#get( )
*/
public get( ) {
= () getSqlMapClientTemplate().queryForObject("get", );
if ( == null) {
throw new ObjectRetrievalFailureException(.class, );
}
return ;
}
/**
* @see .dao.Dao#save( )
*/
public void save(final ) {
= .();
// check for new record
if ( == null) {
= () getSqlMapClientTemplate().insert("add", );
} else {
getSqlMapClientTemplate().update("update", );
}
if( == null ) {
throw new ObjectRetrievalFailureException(.class, );
}
}
/**
* @see .dao.Dao#remove( )
*/
public void remove( ) {
getSqlMapClientTemplate().update("delete", );
}
}