import org.springframework.dao.DataAccessException;
import eu.etaxonomy.cdm.model.common.CdmBase;
-import eu.etaxonomy.cdm.persistence.dao.initializer.IBeanInitializer;
import eu.etaxonomy.cdm.persistence.dto.MergeResult;
import eu.etaxonomy.cdm.persistence.query.Grouping;
import eu.etaxonomy.cdm.persistence.query.MatchMode;
* @return
* @throws DataAccessException
*/
- public List<T> list(Class<? extends T> type, List<Restriction<?>> restrictions, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
+ public <S extends T> List<S> list(Class<S> type, List<Restriction<?>> restrictions, Integer limit, Integer start, List<OrderHint> orderHints, List<String> propertyPaths);
/**
* Counts the Cdm entities matching the restrictions defined by
* {@inheritDoc}\r
*/\r
@Override\r
- public List<T> list(Class<? extends T> type, List<Restriction<?>> restrictions, Integer limit, Integer start,\r
+ public <S extends T> List<S> list(Class<S> type, List<Restriction<?>> restrictions, Integer limit, Integer start,\r
List<OrderHint> orderHints, List<String> propertyPaths) {\r
\r
Criteria criteria = createCriteria(type, restrictions, false);\r
addOrder(criteria, orderHints);\r
\r
@SuppressWarnings("unchecked")\r
- List<T> result = criteria.list();\r
+ List<S> result = criteria.list();\r
defaultBeanInitializer.initializeAll(result, propertyPaths);\r
return result;\r
}\r
private final Serializable id;
protected final EventType eventType;
- /**
- * @param source
- */
+
private CdmDataChangeEvent(
CdmBase entity,
Serializable id,
Assert.assertNotNull("list() should return a list",result);
Assert.assertEquals("list() should return 9 AgentBase entities in the current view", 9 ,result.size());
- List<AgentBase> personResults = agentDao.list(Person.class, restrictions, (Integer)null, (Integer)null, null, null);
+ List<Person> personResults = agentDao.list(Person.class, restrictions, (Integer)null, (Integer)null, null, null);
Assert.assertEquals("list() should return 5 Persons entities", 5, personResults.size());
Restriction<String> givenNameExact = new Restriction<>("givenName", MatchMode.EXACT);