Changeset 3449 for ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/impl/database/ComponentRegistryDao.java
- Timestamp:
- 08/20/13 15:32:37 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/impl/database/ComponentRegistryDao.java
r3048 r3449 2 2 3 3 import java.util.List; 4 5 import javax.sql.DataSource; 6 7 import org.springframework.beans.factory.annotation.Autowired; 8 import org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport; 4 9 import org.springframework.jdbc.core.simple.ParameterizedRowMapper; 5 import org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport;6 10 7 11 /** 8 12 * Logic and constants shared by the dao's of the DB implementation 9 * 10 * TODO: For future extensions we may want to use {@link org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport} 11 * 13 * 14 * 12 15 * @author Twan Goosen <twan.goosen@mpi.nl> 13 * @param <T> Type the dao maps to 16 * @author George.Georgovassilis@mpi.nl 17 * @param <T> 18 * Type the dao maps to 14 19 */ 15 public abstract class ComponentRegistryDao<T> extends SimpleJdbcDaoSupport { 16 17 public final static String TABLE_COMMENTS = "comments"; 18 public final static String TABLE_COMPONENT_DESCRIPTION = "component_description"; 19 public final static String TABLE_PROFILE_DESCRIPTION = "profile_description"; 20 public final static String TABLE_XML_CONTENT = "xml_content"; 21 public final static String TABLE_REGISTRY_USER = "registry_user"; 22 public final static String COLUMN_ID = "id"; 20 public abstract class ComponentRegistryDao<T> extends 21 NamedParameterJdbcDaoSupport implements IComponentRegistryDao<T> { 23 22 24 23 public ComponentRegistryDao() { … … 43 42 44 43 protected List<T> getList(String selectQuery, Object... args) { 45 return get SimpleJdbcTemplate().query(selectQuery, getRowMapper(), args);44 return getJdbcTemplate().query(selectQuery, getRowMapper(), args); 46 45 } 47 46 … … 50 49 */ 51 50 protected abstract ParameterizedRowMapper<T> getRowMapper(); 51 52 @Override 53 @Autowired 54 public void setDatasourceProperty(DataSource ds) { 55 super.setDataSource(ds); 56 } 57 52 58 }
Note: See TracChangeset
for help on using the changeset viewer.