Class HibernateRelationDao<S extends RelatableEntity,T extends RelatableEntity>
- java.lang.Object
-
- com.atlassian.confluence.internal.relations.dao.hibernate.HibernateRelationDao<S,T>
-
- All Implemented Interfaces:
RelationDao<S,T>
- Direct Known Subclasses:
Content2ContentHibernateRelationDao
,User2ContentHibernateRelationDao
,User2UserHibernateRelationDao
public abstract class HibernateRelationDao<S extends RelatableEntity,T extends RelatableEntity> extends Object implements RelationDao<S,T>
- Since:
- 5.9
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
BATCHING_CHUNK_SIZE
protected org.springframework.orm.hibernate5.HibernateTemplate
hibernate
protected static String
RELATION_PARAM_NAME
protected org.hibernate.engine.spi.SessionFactoryImplementor
sessionFactory
protected static String
SOURCE_PARAM_NAME
protected static String
TARGET_PARAM_NAME
-
Constructor Summary
Constructors Constructor Description HibernateRelationDao(org.hibernate.SessionFactory sessionFactory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected RelationEntity<S,T>
constructRelationEntity(RelationEntity<S,T> relationEntity, S source, T target, RelationDescriptor<?,?> relationDescriptor)
RelationEntity<S,T>
createRelationEntity(S source, T target, RelationDescriptor<?,?> relationDescriptor)
Create new relation.protected @NonNull List<RelationEntity<S,T>>
getRelationEntities(String queryName, S source, T target, RelationDescriptor<?,?> relationDescriptor)
protected abstract RelationEntity<S,T>
newRelationEntity(S source, T target)
void
removeRelationEntity(RelationEntity<S,T> relationEntity)
Remove relation-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.internal.relations.dao.RelationDao
getRelationEntity, getRelationsCount, getSources, getSourcesCount, getTargets, getTargetsCount, removeAllRelations, removeAllRelations, removeAllRelationsFromCurrentAndHistoricalEntities, removeAllRelationsFromCurrentAndHistoricalEntities, removeAllRelationsFromEntityWithName
-
-
-
-
Field Detail
-
SOURCE_PARAM_NAME
protected static final String SOURCE_PARAM_NAME
- See Also:
- Constant Field Values
-
TARGET_PARAM_NAME
protected static final String TARGET_PARAM_NAME
- See Also:
- Constant Field Values
-
RELATION_PARAM_NAME
protected static final String RELATION_PARAM_NAME
- See Also:
- Constant Field Values
-
BATCHING_CHUNK_SIZE
protected static final int BATCHING_CHUNK_SIZE
- See Also:
- Constant Field Values
-
hibernate
protected final org.springframework.orm.hibernate5.HibernateTemplate hibernate
-
sessionFactory
protected final org.hibernate.engine.spi.SessionFactoryImplementor sessionFactory
-
-
Method Detail
-
createRelationEntity
public RelationEntity<S,T> createRelationEntity(S source, T target, RelationDescriptor<?,?> relationDescriptor)
Description copied from interface:RelationDao
Create new relation. and saves it to the database- Specified by:
createRelationEntity
in interfaceRelationDao<S extends RelatableEntity,T extends RelatableEntity>
relationDescriptor
- specifies relation metadata, such as type and name- See Also:
RelationEntity
-
removeRelationEntity
public void removeRelationEntity(RelationEntity<S,T> relationEntity)
Description copied from interface:RelationDao
Remove relation- Specified by:
removeRelationEntity
in interfaceRelationDao<S extends RelatableEntity,T extends RelatableEntity>
- See Also:
RelationEntity
-
getRelationEntities
protected @NonNull List<RelationEntity<S,T>> getRelationEntities(String queryName, S source, T target, RelationDescriptor<?,?> relationDescriptor)
-
newRelationEntity
protected abstract RelationEntity<S,T> newRelationEntity(S source, T target)
-
constructRelationEntity
protected RelationEntity<S,T> constructRelationEntity(RelationEntity<S,T> relationEntity, S source, T target, RelationDescriptor<?,?> relationDescriptor)
-
-