Ignore:
Timestamp:
08/20/13 15:32:37 (11 years ago)
Author:
George.Georgovassilis@mpi.nl
Message:

#360 Refactoring of transaction handling, tests and application context

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ComponentRegistry/trunk/ComponentRegistry/src/main/java/clarin/cmdi/componentregistry/impl/database/ComponentRegistryDao.java

    r3048 r3449  
    22
    33import java.util.List;
     4
     5import javax.sql.DataSource;
     6
     7import org.springframework.beans.factory.annotation.Autowired;
     8import org.springframework.jdbc.core.namedparam.NamedParameterJdbcDaoSupport;
    49import org.springframework.jdbc.core.simple.ParameterizedRowMapper;
    5 import org.springframework.jdbc.core.simple.SimpleJdbcDaoSupport;
    610
    711/**
    812 * 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 *
    1215 * @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
    1419 */
    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";
     20public abstract class ComponentRegistryDao<T> extends
     21        NamedParameterJdbcDaoSupport implements IComponentRegistryDao<T> {
    2322
    2423    public ComponentRegistryDao() {
     
    4342
    4443    protected List<T> getList(String selectQuery, Object... args) {
    45         return getSimpleJdbcTemplate().query(selectQuery, getRowMapper(), args);
     44        return getJdbcTemplate().query(selectQuery, getRowMapper(), args);
    4645    }
    4746
     
    5049     */
    5150    protected abstract ParameterizedRowMapper<T> getRowMapper();
     51
     52    @Override
     53    @Autowired
     54    public void setDatasourceProperty(DataSource ds) {
     55        super.setDataSource(ds);
     56    }
     57
    5258}
Note: See TracChangeset for help on using the changeset viewer.