T - the PDO class typeP - the persistence class typepublic class PersistentObjectClassVariables<T extends PersistentDomainObject<T>,P extends AbstractPersistentObject<T,P>> extends DbObjectClassVariables<P>
DbObjectClassVariables for AbstractPersistentObjects.DbObjectClassVariables.ForeignReferencealwaysPrepare, classBaseName, classId, clazz, columnCount, deleteStatementId, dummyUpdateStatementId, expirationBacklog, foreignReferences, idSource, insertStatementId, properties, remoteDelegateId, selectAllIdSerialStatementId, selectAllObjectsStatementId, selectExpiredTableSerials1StatementId, selectExpiredTableSerials2StatementId, selectLockedStatementId, selectMaxIdStatementId, selectMaxTableSerialStatementId, selectObjectStatementId, selectSerialStatementId, tableName, updateSerialAndTableSerialStatementId, updateSerialStatementId, updateStatementId, updateTableSerialStatementId| Constructor and Description |
|---|
PersistentObjectClassVariables(Class<T> pdoClass,
Class<P> poClass,
String alias)
Constructs a classvariable.
|
PersistentObjectClassVariables(Class<T> pdoClass,
Class<P> poClass,
String tableAlias,
PersistentObjectClassVariables<? super T,? super P> superClassVariables,
List<Join<T,?>> eagerJoins)
Constructs a classvariable.
|
| Modifier and Type | Method and Description |
|---|---|
protected boolean |
checkClassPermission(DomainContext context,
Permission permission)
Check security for this class.
|
protected int |
determineReferencePriority(Class<? extends AbstractDbObject<?>> clazz)
Determine the referencing priority.
|
String |
getColumnName(String name)
Gets the full column name with optional table alias.
|
List<Join<T,?>> |
getEagerJoins()
Gets the eager joins.
|
String |
getTableAlias()
Gets the table alias.
|
String |
getTableName()
Returns the tablename for this classvariable.
|
PersistentObjectClassVariables<? super T,? super P> |
getTopSuperClassVariables()
Returns the topmost classvariables.
Useful for multi-inheritance. |
boolean |
isAbstract()
Returns whether the pdo class is abstract.
|
boolean |
isEditAllowed(AbstractPersistentObject<?,?> object)
Check the edit security for a single object.
|
boolean |
isReadAllowed()
Check the read security for this class in all contexts.
|
boolean |
isReadAllowed(AbstractPersistentObject<?,?> object)
Check the read security for a single object.
|
<T extends AbstractPersistentObject<?,?>,C extends Collection<T>> |
isReadAllowed(C objects)
Checks the read security for a collection of objects of this class.
The returned collection is of the same type as the original collection. |
boolean |
isReadAllowed(DomainContext context)
Check the read security for this class.
|
boolean |
isReferenced(Db db,
long id)
Determines whether the class of this variable holder is referenced.
|
boolean |
isViewAllowed(AbstractPersistentObject<?,?> object)
Check the view security for a single object.
|
boolean |
isWriteAllowed()
Check the write security for this class in all contexts.
|
boolean |
isWriteAllowed(AbstractPersistentObject<?,?> object)
Check the write security for a single object.
|
<T extends AbstractPersistentObject<?,?>,C extends Collection<T>> |
isWriteAllowed(C objects)
Checks the write security for a collection of objects of this class.
The returned collection is of the same type as the original collection. |
boolean |
isWriteAllowed(DomainContext context)
Check the write security for this class.
|
protected void |
loadMoreProperties()
Loads more properties.
Invoked from constructor. |
String |
toString() |
addReferencingClass, createBacklog, getIdSource, getProperty, getRemoteDelegate, getRemoteDelegateId, getVariables, isReferencedImpl, loadProperties, putProperty, putVariables, removeReferencingClasspublic static final String PROPERTY_CHECKSECURITY
public static final String CLASSVARIABLES_NAME
public final Class<T extends PersistentDomainObject<T>> pdoClass
public final List<Join<T extends PersistentDomainObject<T>,?>> eagerJoins
public final String pdoClassBaseName
public String tableAlias
public final PersistentObjectClassVariables<? super T extends PersistentDomainObject<T>,? super P extends AbstractPersistentObject<T,P>> superClassVariables
public PersistentObjectClassVariables<? super T extends PersistentDomainObject<T>,? super P extends AbstractPersistentObject<T,P>> topSuperClassVariables
public boolean checkSecurity
public final StatementId selectByNormTextStatementId
AbstractPersistentObject.selectByNormText(java.lang.String).public final StatementId selectAllStatementId
AbstractPersistentObject.selectAll().public final StatementId selectByNormTextCursorStatementId
AbstractPersistentObject.selectByNormTextAsCursor(java.lang.String).public final StatementId selectAllCursorStatementId
AbstractPersistentObject.selectAllAsCursor().public final StatementId updateTokenLockStatementId
public final StatementId updateTokenLockOnlyStatementId
AbstractPersistentObject.updateTokenLockOnly().public final StatementId selectTokenLockStatementId
AbstractPersistentObject.updateTokenLock(org.tentackle.common.Timestamp, long, org.tentackle.common.Timestamp).public final StatementId transferTokenLockStatementId
AbstractPersistentObject.transferTokenLock(long).public PersistentObjectClassVariables(Class<T> pdoClass, Class<P> poClass, String tableAlias, PersistentObjectClassVariables<? super T,? super P> superClassVariables, List<Join<T,?>> eagerJoins)
Notice: the superPoClass is necessary only in SINGLE and MULTI table inheritance configurations.
pdoClass - the PDO's class (i.e. interface)poClass - the class of the persistence implementationtableAlias - the table alias to be used in joined selectssuperClassVariables - the class variables of the superclass, null if not inheritedeagerJoins - the optional eager joins, null of empty if nonepublic PersistentObjectClassVariables(Class<T> pdoClass, Class<P> poClass, String alias)
pdoClass - the PDO's class (i.e. interface)poClass - the class of the persistence implementationalias - the table alias to be used in joined selectspublic List<Join<T,?>> getEagerJoins()
public String getTableName()
If the class has no tablename, it is derived from its superclasses.
public String getTableAlias()
If the class has no tablename, it is derived from its superclasses.
public String getColumnName(String name)
name - the short namepublic PersistentObjectClassVariables<? super T,? super P> getTopSuperClassVariables()
protected void loadMoreProperties()
public boolean isReferenced(Db db, long id)
DbObjectClassVariablesisReferenced in class DbObjectClassVariables<P extends AbstractPersistentObject<T,P>>db - the Db connectionid - the object id to test whether it is referenced by any other objectspublic String toString()
toString in class DbObjectClassVariables<P extends AbstractPersistentObject<T,P>>public boolean isAbstract()
public boolean isReadAllowed(DomainContext context)
Notice that SecurityPersistenceImpl objects are always readable!
context - the current domain context, null = allpublic boolean isReadAllowed()
public boolean isWriteAllowed(DomainContext context)
context - the current domain context, null = allpublic boolean isWriteAllowed()
public boolean isReadAllowed(AbstractPersistentObject<?,?> object)
This is a low-level method. Only root entities are checked. Components must check their root-entity!
object - the object to check the security rules for.public boolean isWriteAllowed(AbstractPersistentObject<?,?> object)
This is a low-level method. Only root entities are checked. Components must check their root-entity!
object - the object to check the security rules for.public boolean isViewAllowed(AbstractPersistentObject<?,?> object)
This is a low-level method. Only root entities are checked. Components must check their root-entity!
object - the object to check the security rules for.public boolean isEditAllowed(AbstractPersistentObject<?,?> object)
This is a low-level method. Only root entities are checked. Components must check their root-entity!
object - the object to check the security rules for.public <T extends AbstractPersistentObject<?,?>,C extends Collection<T>> C isReadAllowed(C objects)
Notice that SecurityPersistenceImpl objects are always readable!
T - AbstractPersistentObject classC - Collection classobjects - the collection to check the security rules for.public <T extends AbstractPersistentObject<?,?>,C extends Collection<T>> C isWriteAllowed(C objects)
T - AbstractPersistentObject classC - Collection classobjects - the collection to check the security rules for.protected int determineReferencePriority(Class<? extends AbstractDbObject<?>> clazz)
The default implementation returns 0. Provided to be overridden.
Overridden to determine the priority according to the presence of a cache:
determineReferencePriority in class DbObjectClassVariables<P extends AbstractPersistentObject<T,P>>clazz - the referencing classprotected boolean checkClassPermission(DomainContext context, Permission permission)
context - the domain contextpermission - the permissionCopyright © 2016 Krake Softwaretechnik. All rights reserved.