Class AbstractAnyDAO<A extends Any<?>>
- java.lang.Object
-
- org.apache.syncope.core.persistence.jpa.dao.AbstractDAO<A>
-
- org.apache.syncope.core.persistence.jpa.dao.AbstractAnyDAO<A>
-
- Direct Known Subclasses:
JPAAnyObjectDAO
,JPAGroupDAO
,JPAUserDAO
public abstract class AbstractAnyDAO<A extends Any<?>> extends AbstractDAO<A> implements AnyDAO<A>
-
-
Field Summary
Fields Modifier and Type Field Description protected AnyUtilsFactory
anyUtilsFactory
protected DerSchemaDAO
derSchemaDAO
protected DynRealmDAO
dynRealmDAO
protected PlainSchemaDAO
plainSchemaDAO
-
Fields inherited from class org.apache.syncope.core.persistence.jpa.dao.AbstractDAO
LOG
-
Fields inherited from interface org.apache.syncope.core.persistence.api.dao.AnyDAO
DEFAULT_PAGE_SIZE
-
-
Constructor Summary
Constructors Constructor Description AbstractAnyDAO(AnyUtilsFactory anyUtilsFactory, PlainSchemaDAO plainSchemaDAO, DerSchemaDAO derSchemaDAO, DynRealmDAO dynRealmDAO)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected AnyUtils
anyUtils()
A
authFind(String key)
void
delete(String key)
A
find(String key)
protected List<String>
findAllKeys(String table, int page, int itemsPerPage)
<S extends Schema>
AllowedSchemas<S>findAllowedSchemas(A any, Class<S> reference)
List<A>
findByDerAttrValue(DerSchema schema, String value, boolean ignoreCaseMatch)
Find any objects by derived attribute value.List<A>
findByKeys(List<String> keys)
Optional<A>
findByPlainAttrUniqueValue(PlainSchema schema, PlainAttrUniqueValue attrUniqueValue, boolean ignoreCaseMatch)
List<A>
findByPlainAttrValue(PlainSchema schema, PlainAttrValue attrValue, boolean ignoreCaseMatch)
List<A>
findByResource(ExternalResource resource)
List<String>
findDynRealms(String key)
protected OffsetDateTime
findLastChange(String key, String table)
SearchCond
getAllMatchingCond()
protected abstract AnyUtils
init()
A
save(A any)
protected abstract void
securityChecks(A any)
-
Methods inherited from class org.apache.syncope.core.persistence.jpa.dao.AbstractDAO
detach, entityManager, entityManagerFactory, isOracle, refresh
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.syncope.core.persistence.api.dao.AnyDAO
count, delete, findAll, findAllKeys, findAllResourceKeys, findLastChange
-
-
-
-
Field Detail
-
anyUtilsFactory
protected final AnyUtilsFactory anyUtilsFactory
-
plainSchemaDAO
protected final PlainSchemaDAO plainSchemaDAO
-
derSchemaDAO
protected final DerSchemaDAO derSchemaDAO
-
dynRealmDAO
protected final DynRealmDAO dynRealmDAO
-
-
Constructor Detail
-
AbstractAnyDAO
public AbstractAnyDAO(AnyUtilsFactory anyUtilsFactory, PlainSchemaDAO plainSchemaDAO, DerSchemaDAO derSchemaDAO, DynRealmDAO dynRealmDAO)
-
-
Method Detail
-
init
protected abstract AnyUtils init()
-
anyUtils
protected AnyUtils anyUtils()
-
findLastChange
protected OffsetDateTime findLastChange(String key, String table)
-
securityChecks
protected abstract void securityChecks(A any)
-
findByKeys
@Transactional(readOnly=true) public List<A> findByKeys(List<String> keys)
- Specified by:
findByKeys
in interfaceAnyDAO<A extends Any<?>>
-
authFind
@Transactional(readOnly=true) public A authFind(String key)
-
find
@Transactional(readOnly=true) public A find(String key)
-
findByPlainAttrValue
public List<A> findByPlainAttrValue(PlainSchema schema, PlainAttrValue attrValue, boolean ignoreCaseMatch)
- Specified by:
findByPlainAttrValue
in interfaceAnyDAO<A extends Any<?>>
-
findByPlainAttrUniqueValue
public Optional<A> findByPlainAttrUniqueValue(PlainSchema schema, PlainAttrUniqueValue attrUniqueValue, boolean ignoreCaseMatch)
- Specified by:
findByPlainAttrUniqueValue
in interfaceAnyDAO<A extends Any<?>>
-
findByDerAttrValue
public List<A> findByDerAttrValue(DerSchema schema, String value, boolean ignoreCaseMatch)
Description copied from interface:AnyDAO
Find any objects by derived attribute value. This method could fail if one or more string literals contained into the derived attribute value provided derive from identifier (schema key) replacement. When you are going to specify a derived attribute expression you must be quite sure that string literals used to build the expression cannot be found into the attribute values used to replace attribute schema keys used as identifiers.- Specified by:
findByDerAttrValue
in interfaceAnyDAO<A extends Any<?>>
- Parameters:
schema
- derived schemavalue
- derived attribute valueignoreCaseMatch
- whether comparison for string values should take case into account or not- Returns:
- list of any objects
-
findByResource
public List<A> findByResource(ExternalResource resource)
- Specified by:
findByResource
in interfaceAnyDAO<A extends Any<?>>
-
getAllMatchingCond
public SearchCond getAllMatchingCond()
- Specified by:
getAllMatchingCond
in interfaceAnyDAO<A extends Any<?>>
- Returns:
- the search condition to match all entities
-
findAllowedSchemas
@Transactional(propagation=REQUIRES_NEW, readOnly=true) public <S extends Schema> AllowedSchemas<S> findAllowedSchemas(A any, Class<S> reference)
- Specified by:
findAllowedSchemas
in interfaceAnyDAO<A extends Any<?>>
-
findDynRealms
@Transactional(readOnly=true) public List<String> findDynRealms(String key)
- Specified by:
findDynRealms
in interfaceAnyDAO<A extends Any<?>>
-
-