Package org.exoplatform.agenda.dao
Class CalendarDAO
java.lang.Object
org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<CalendarEntity,Long>
org.exoplatform.agenda.dao.CalendarDAO
- All Implemented Interfaces:
org.exoplatform.commons.api.persistence.GenericDAO<CalendarEntity,Long>
public class CalendarDAO
extends org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<CalendarEntity,Long>
-
Field Summary
Fields inherited from class org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl
modelClass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcountCalendarsByOwnerIds(Long... ownerIds) create(CalendarEntity entity) In addition to the generic creation, initializes the creation date and generates a stable synchronization identifier (SYNC_UID) when none was provided, so that every stored calendar carries an environment-independent unique identifier.voidcreateAll(List<CalendarEntity> entities) voiddelete(CalendarEntity entity) voidvoiddeleteAll(List<CalendarEntity> entities) getCalendarIdsByOwnerIds(int offset, int limit, Long... ownerIds) getSystemCalendarIdByOwnerId(long ownerId) Retrieves the technical identifier of the system (default) calendar of a given owner.update(CalendarEntity entity) Updates a calendar, giving it aSYNC_UIDwhen it still has none.voidupdateAll(List<CalendarEntity> entities) Methods inherited from class org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl
count, find, findAll, getEntityManager, getHibernateDialect, isMSSQLDialect, isOrcaleDialect
-
Constructor Details
-
CalendarDAO
public CalendarDAO()
-
-
Method Details
-
delete
- Specified by:
deletein interfaceorg.exoplatform.commons.api.persistence.GenericDAO<CalendarEntity,Long> - Overrides:
deletein classorg.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<CalendarEntity,Long>
-
create
In addition to the generic creation, initializes the creation date and generates a stable synchronization identifier (SYNC_UID) when none was provided, so that every stored calendar carries an environment-independent unique identifier.- Specified by:
createin interfaceorg.exoplatform.commons.api.persistence.GenericDAO<CalendarEntity,Long> - Overrides:
createin classorg.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<CalendarEntity,Long>
-
update
Updates a calendar, giving it aSYNC_UIDwhen it still has none.The same guard
create(CalendarEntity)applies, for the calendars that predate the column: one restored from an old backup after the migration ran would otherwise carry no anchor and be invisible to every integration that binds by it. This complements the migration rather than replacing it — the calendar that matters most is the system one, which is almost never updated.- Specified by:
updatein interfaceorg.exoplatform.commons.api.persistence.GenericDAO<CalendarEntity,Long> - Overrides:
updatein classorg.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<CalendarEntity,Long>
-
getCalendarIdsByOwnerIds
-
getSystemCalendarIdByOwnerId
Retrieves the technical identifier of the system (default) calendar of a given owner. When several system calendars exist for the same owner (a data anomaly), the oldest one is returned to keep the result deterministic.- Parameters:
ownerId- technical identifier of the calendar owner identity- Returns:
- technical identifier of the owner's system calendar, or
nullwhen the owner has no system calendar
-
countCalendarsByOwnerIds
-
deleteAll
public void deleteAll()- Specified by:
deleteAllin interfaceorg.exoplatform.commons.api.persistence.GenericDAO<CalendarEntity,Long> - Overrides:
deleteAllin classorg.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<CalendarEntity,Long>
-
deleteAll
- Specified by:
deleteAllin interfaceorg.exoplatform.commons.api.persistence.GenericDAO<CalendarEntity,Long> - Overrides:
deleteAllin classorg.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<CalendarEntity,Long>
-
createAll
- Specified by:
createAllin interfaceorg.exoplatform.commons.api.persistence.GenericDAO<CalendarEntity,Long> - Overrides:
createAllin classorg.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<CalendarEntity,Long>
-
updateAll
- Specified by:
updateAllin interfaceorg.exoplatform.commons.api.persistence.GenericDAO<CalendarEntity,Long> - Overrides:
updateAllin classorg.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<CalendarEntity,Long>
-