Class EntityRelationRepositoryImpl
- java.lang.Object
-
- de.digitalcollections.cudami.server.backend.impl.database.AbstractPagingAndSortingRepositoryImpl
-
- de.digitalcollections.cudami.server.backend.impl.jdbi.JdbiRepositoryImpl
-
- de.digitalcollections.cudami.server.backend.impl.jdbi.identifiable.entity.relation.EntityRelationRepositoryImpl
-
- All Implemented Interfaces:
EntityRelationRepository
@Repository public class EntityRelationRepositoryImpl extends JdbiRepositoryImpl implements EntityRelationRepository
-
-
Field Summary
Fields Modifier and Type Field Description static StringMAPPING_PREFIXstatic StringTABLE_ALIASstatic StringTABLE_NAME-
Fields inherited from class de.digitalcollections.cudami.server.backend.impl.jdbi.JdbiRepositoryImpl
dbi, mappingPrefix, tableAlias, tableName
-
-
Constructor Summary
Constructors Constructor Description EntityRelationRepositoryImpl(org.jdbi.v3.core.Jdbi dbi, EntityRepositoryImpl<de.digitalcollections.model.identifiable.entity.Entity> entityRepositoryImpl)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddRelation(UUID subjectEntityUuid, String predicate, UUID objectEntityUuid)voiddeleteBySubject(UUID subjectEntityUuid)de.digitalcollections.model.paging.PageResponse<de.digitalcollections.model.identifiable.entity.relation.EntityRelation>find(de.digitalcollections.model.paging.PageRequest pageRequest)List<de.digitalcollections.model.identifiable.entity.relation.EntityRelation>findBySubject(de.digitalcollections.model.identifiable.entity.Entity subjectEntity)List<de.digitalcollections.model.identifiable.entity.relation.EntityRelation>findBySubject(UUID subjectEntityUuid)protected List<String>getAllowedOrderByFields()protected StringgetColumnName(String modelProperty)List<de.digitalcollections.model.identifiable.entity.relation.EntityRelation>save(List<de.digitalcollections.model.identifiable.entity.relation.EntityRelation> entityRelations)voidsave(UUID subjectEntityUuid, String predicate, UUID objectEntityUuid)-
Methods inherited from class de.digitalcollections.cudami.server.backend.impl.jdbi.JdbiRepositoryImpl
count, getMappingPrefix, getTableAlias, getTableName
-
Methods inherited from class de.digitalcollections.cudami.server.backend.impl.database.AbstractPagingAndSortingRepositoryImpl
addFiltering, addFiltering, addLimit, addOffset, addOrderBy, addPageRequestParams, convertToSqlString, getFilterClauses, getOrderBy, getWhereClause
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.digitalcollections.cudami.server.backend.api.repository.identifiable.entity.relation.EntityRelationRepository
addRelation, deleteBySubject, save
-
-
-
-
Field Detail
-
MAPPING_PREFIX
public static final String MAPPING_PREFIX
- See Also:
- Constant Field Values
-
TABLE_ALIAS
public static final String TABLE_ALIAS
- See Also:
- Constant Field Values
-
TABLE_NAME
public static final String TABLE_NAME
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
EntityRelationRepositoryImpl
@Autowired public EntityRelationRepositoryImpl(org.jdbi.v3.core.Jdbi dbi, @Qualifier("entityRepositoryImpl") EntityRepositoryImpl<de.digitalcollections.model.identifiable.entity.Entity> entityRepositoryImpl)
-
-
Method Detail
-
addRelation
public void addRelation(UUID subjectEntityUuid, String predicate, UUID objectEntityUuid)
- Specified by:
addRelationin interfaceEntityRelationRepository
-
deleteBySubject
public void deleteBySubject(UUID subjectEntityUuid)
- Specified by:
deleteBySubjectin interfaceEntityRelationRepository
-
find
public de.digitalcollections.model.paging.PageResponse<de.digitalcollections.model.identifiable.entity.relation.EntityRelation> find(de.digitalcollections.model.paging.PageRequest pageRequest)
- Specified by:
findin interfaceEntityRelationRepository
-
findBySubject
public List<de.digitalcollections.model.identifiable.entity.relation.EntityRelation> findBySubject(UUID subjectEntityUuid)
- Specified by:
findBySubjectin interfaceEntityRelationRepository
-
findBySubject
public List<de.digitalcollections.model.identifiable.entity.relation.EntityRelation> findBySubject(de.digitalcollections.model.identifiable.entity.Entity subjectEntity)
- Specified by:
findBySubjectin interfaceEntityRelationRepository
-
getAllowedOrderByFields
protected List<String> getAllowedOrderByFields()
- Specified by:
getAllowedOrderByFieldsin classAbstractPagingAndSortingRepositoryImpl- Returns:
- model properties names that are applicable for sorting, will be mapped to database column names using @see #getColumnName
-
getColumnName
protected String getColumnName(String modelProperty)
- Specified by:
getColumnNamein classAbstractPagingAndSortingRepositoryImpl- Parameters:
modelProperty- name of model property passed as String, e.g. "lastModified"- Returns:
- full qualified column name as used in sql queries ("last_modified" or e.g. "w.last_modified" if prefix used in queries)
-
save
public void save(UUID subjectEntityUuid, String predicate, UUID objectEntityUuid)
- Specified by:
savein interfaceEntityRelationRepository
-
save
public List<de.digitalcollections.model.identifiable.entity.relation.EntityRelation> save(List<de.digitalcollections.model.identifiable.entity.relation.EntityRelation> entityRelations)
- Specified by:
savein interfaceEntityRelationRepository
-
-