Class AbstractCollectionInitializer
java.lang.Object
ch.tocco.nice2.persist.core.api.hibernate.interceptor.AbstractCollectionInitializer
- All Implemented Interfaces:
CollectionInitializer
- Direct Known Subclasses:
AbstractEntityDocsCollectionInitializer
,DefaultCollectionInitializer
,EntityDocsRootFolderCollectionInitializer
,NodeChildrenCollectionInitializer
,PrivilegedCollectionInitializer
Abstract implementation od
CollectionInitializer
which resolves a collection
by using the reverse relation name.-
Field Summary
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractCollectionInitializer
(PersistenceService persistService, DataModel dataModel) -
Method Summary
Modifier and TypeMethodDescriptionlong
countCollectionElements
(jakarta.persistence.metamodel.EntityType<?> entityType, jakarta.persistence.metamodel.Attribute<?, ?> collection, Serializable id) protected <T extends QueryBuilderBase<?,
?>>
TcreateQueryBuilder
(Function<Class<? extends Entity>, T> builderProvider, jakarta.persistence.metamodel.EntityType<?> entityType, jakarta.persistence.metamodel.Attribute<?, ?> collection, Serializable id) protected long
doCountCollectionElements
(CountQueryBuilder queryBuilder) protected List
<?> doGetCollectionElements
(CriteriaQueryBuilder<?, ?, ?> queryBuilder, Pagination pagination, @Nullable Ordering ordering) List
<?> getCollectionElements
(jakarta.persistence.metamodel.EntityType<?> entityType, jakarta.persistence.metamodel.Attribute<?, ?> collection, Serializable id, Pagination pagination, @Nullable Ordering ordering) protected void
modifyDefaultQuery
(QueryBuilderBase<?, ?> queryBuilder) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface ch.tocco.nice2.persist.core.api.hibernate.interceptor.CollectionInitializer
priority, supports
-
Field Details
-
persistService
-
dataModel
-
-
Constructor Details
-
AbstractCollectionInitializer
-
-
Method Details
-
getCollectionElements
public List<?> getCollectionElements(jakarta.persistence.metamodel.EntityType<?> entityType, jakarta.persistence.metamodel.Attribute<?, ?> collection, Serializable id, Pagination pagination, @Nullable @Nullable Ordering ordering) - Specified by:
getCollectionElements
in interfaceCollectionInitializer
- Returns:
- the collection elements of a specific relation
-
doGetCollectionElements
protected List<?> doGetCollectionElements(CriteriaQueryBuilder<?, ?, ?> queryBuilder, Pagination pagination, @Nullable @Nullable Ordering ordering) -
countCollectionElements
public long countCollectionElements(jakarta.persistence.metamodel.EntityType<?> entityType, jakarta.persistence.metamodel.Attribute<?, ?> collection, Serializable id) - Specified by:
countCollectionElements
in interfaceCollectionInitializer
- Returns:
- the number of persisted collection elements
-
doCountCollectionElements
-
createQueryBuilder
protected <T extends QueryBuilderBase<?,?>> T createQueryBuilder(Function<Class<? extends Entity>, T> builderProvider, jakarta.persistence.metamodel.EntityType<?> entityType, jakarta.persistence.metamodel.Attribute<?, ?> collection, Serializable id) -
modifyDefaultQuery
-