eu.etaxonomy.cdm.persistence.dao.hibernate.common
Class AnnotatableDaoImpl<T extends AnnotatableEntity>

java.lang.Object
  extended by eu.etaxonomy.cdm.persistence.dao.hibernate.common.DaoBase
      extended by eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase<T>
          extended by eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase<T>
              extended by eu.etaxonomy.cdm.persistence.dao.hibernate.common.AnnotatableDaoImpl<T>
All Implemented Interfaces:
IAnnotatableDao<T>, ICdmEntityDao<T>, IVersionableDao<T>
Direct Known Subclasses:
DescriptionElementDaoImpl, EventBaseDaoImpl, IdentifiableDaoBase, LanguageStringBaseDaoImpl, TaxonNodeDaoHibernateImpl, WorkingSetDao

public abstract class AnnotatableDaoImpl<T extends AnnotatableEntity>
extends VersionableDaoBase<T>
implements IAnnotatableDao<T>

Version:
1.0
Author:
n.hoffmann

Field Summary
 
Fields inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase
defaultBeanInitializer, flushAfterNo, type, version
 
Constructor Summary
AnnotatableDaoImpl(Class<T> type)
           
 
Method Summary
 int countAnnotations(T annotatableEntity, MarkerType status)
          Returns a count of Annotations belonging to the supplied AnnotatableEntity
 int countMarkers(Class<? extends T> clazz, Boolean technical)
          returns a count of all markers belonging to that clazz, optionally filtered to include only technical or only non-technical markers.
 int countMarkers(T annotatableEntity, Boolean technical)
          Returns a count of Markers belonging to the supplied AnnotatableEntity
 List<Annotation> getAnnotations(T annotatableEntity, MarkerType status, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
          Returns a List of Annotations belonging to the supplied AnnotatableEntity
 List<Marker> getMarkers(T annotatableEntity, Boolean technical, Integer pageSize, Integer pageNumber, List<OrderHint> orderHints, List<String> propertyPaths)
           
 List<Object[]> groupMarkers(Class<? extends T> clazz, Boolean technical, Integer pageSize, Integer pageNumber, List<String> propertyPaths)
          Returns a list of arrays representing counts of entities of type clazz, grouped by their markerTypes.
 
Methods inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.VersionableDaoBase
addCriteria, addOrder, checkNotInPriorView, count, count, count, countAuditEvents, countAuditEvents, countByParam, exists, findByParam, findByUuid, getAuditEventFromContext, getAuditEvents, getAuditEvents, getAuditReader, getNextAuditEvent, getPreviousAuditEvent, list, list, list, list, load, load
 
Methods inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.CdmEntityDaoBase
addCriteria, addExample, addGroups, addOrder, clear, countGroups, delete, findById, getSession, getType, group, list, list, list, list, listByIds, load, lock, merge, refresh, refresh, replace, rows, save, saveAll, saveCdmObj, saveOrUpdate, saveOrUpdateAll, setDefaultBeanInitializer, setPagingParameter, setPagingParameter, update
 
Methods inherited from class eu.etaxonomy.cdm.persistence.dao.hibernate.common.DaoBase
addOrder, flush, getSessionFactory, setSessionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface eu.etaxonomy.cdm.persistence.dao.common.IVersionableDao
countAuditEvents, countAuditEvents, getAuditEvents, getAuditEvents, getNextAuditEvent, getPreviousAuditEvent
 
Methods inherited from interface eu.etaxonomy.cdm.persistence.dao.common.ICdmEntityDao
clear, count, count, count, delete, exists, findById, findByUuid, flush, getSession, getType, group, list, list, list, list, list, list, list, listByIds, load, load, load, lock, merge, refresh, refresh, replace, rows, save, saveAll, saveOrUpdate, saveOrUpdateAll, update
 

Constructor Detail

AnnotatableDaoImpl

public AnnotatableDaoImpl(Class<T> type)
Parameters:
type -
Method Detail

countAnnotations

public int countAnnotations(T annotatableEntity,
                            MarkerType status)
Description copied from interface: IAnnotatableDao
Returns a count of Annotations belonging to the supplied AnnotatableEntity

Specified by:
countAnnotations in interface IAnnotatableDao<T extends AnnotatableEntity>
Parameters:
annotatableEntity - the entity which is annotated
status - The status of the annotations (null to count all annotations regardless of status)
Returns:
a count of Annotation instances

getAnnotations

public List<Annotation> getAnnotations(T annotatableEntity,
                                       MarkerType status,
                                       Integer pageSize,
                                       Integer pageNumber,
                                       List<OrderHint> orderHints,
                                       List<String> propertyPaths)
Description copied from interface: IAnnotatableDao
Returns a List of Annotations belonging to the supplied AnnotatableEntity

Specified by:
getAnnotations in interface IAnnotatableDao<T extends AnnotatableEntity>
Parameters:
annotatableEntity - the entity which is annotated
status - The status of the annotations (null to return annotations regardless of status)
pageSize - The maximum number of annotations returned (can be null for all annotations)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
orderHints - may be null
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a List of Annotation instances

countMarkers

public int countMarkers(T annotatableEntity,
                        Boolean technical)
Description copied from interface: IAnnotatableDao
Returns a count of Markers belonging to the supplied AnnotatableEntity

Specified by:
countMarkers in interface IAnnotatableDao<T extends AnnotatableEntity>
Parameters:
annotatableEntity - the entity which is marked
technical - The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
Returns:
a count of Marker instances

getMarkers

public List<Marker> getMarkers(T annotatableEntity,
                               Boolean technical,
                               Integer pageSize,
                               Integer pageNumber,
                               List<OrderHint> orderHints,
                               List<String> propertyPaths)
Specified by:
getMarkers in interface IAnnotatableDao<T extends AnnotatableEntity>
Parameters:
annotatableEntity - the entity which is marked
technical - The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
pageSize - The maximum number of markers returned (can be null for all markers)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
orderHints - may be null
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:
a List of Marker instances

countMarkers

public int countMarkers(Class<? extends T> clazz,
                        Boolean technical)
Description copied from interface: IAnnotatableDao
returns a count of all markers belonging to that clazz, optionally filtered to include only technical or only non-technical markers.

Specified by:
countMarkers in interface IAnnotatableDao<T extends AnnotatableEntity>
Parameters:
clazz - optionally restrict the markers to those belonging to this class
technical - The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
Returns:
a count of markers

groupMarkers

public List<Object[]> groupMarkers(Class<? extends T> clazz,
                                   Boolean technical,
                                   Integer pageSize,
                                   Integer pageNumber,
                                   List<String> propertyPaths)
Description copied from interface: IAnnotatableDao
Returns a list of arrays representing counts of entities of type clazz, grouped by their markerTypes. The arrays have two elements. The first element is the MarkerType, initialized using the propertyPaths parameter. The second element is the count of all markers of Objects of type clazz with that MarkerType. The boolean technical can be used to choose only technical or only non-technical marker types. The list is sorted by titleCache of the markerType, in ascending order.

Specified by:
groupMarkers in interface IAnnotatableDao<T extends AnnotatableEntity>
Parameters:
clazz - optionally restrict the markers to those belonging to this class
technical - The type of MarkerTypes to consider (null to count all markers, regardless of whether the makerType is technical or not)
pageSize - The maximum number of arrays returned (can be null for all arrays)
pageNumber - The offset (in pageSize chunks) from the start of the result set (0 - based)
propertyPaths - properties to initialize - see IBeanInitializer.initialize(Object, List)
Returns:


Copyright © 2007-2013 EDIT. All Rights Reserved.