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, remoteDelegateId, selectAllIdSerialStatementId, selectAllObjectsStatementId, selectExpiredTableSerials1StatementId, selectExpiredTableSerials2StatementId, selectForUpdateStatementId, selectMaxIdStatementId, selectMaxTableSerialStatementId, selectObjectStatementId, selectObjectsWithExpiredTableSerialsStatementId, selectSerialStatementId, tableName, updateAndSetSerialStatementId, 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) |
protected Method |
findSnapshotMethod(String methodName,
Class<?> clazz)
Finds a snapshot method.
Snapshot methods ( AbstractPersistentObject.createAttributesInSnapshot(org.tentackle.persist.AbstractPersistentObject), AbstractPersistentObject.createComponentsInSnapshot(org.tentackle.persist.AbstractPersistentObject),
AbstractPersistentObject.revertAttributesToSnapshot(org.tentackle.persist.AbstractPersistentObject) and AbstractPersistentObject.revertComponentsToSnapshot(org.tentackle.persist.AbstractPersistentObject)) take the snapshot
object with the correct implementation type and are implemented at some implementation class. |
String |
getColumnName(String name)
Gets the full column name with optional table alias.
|
Method |
getCreateAttributesInSnapshotMethod()
Gets the method createAttributesInSnapshot of the persistence object.
|
Method |
getCreateComponentsInSnapshotMethod()
Gets the method createComponentsInSnapshot of the persistence object.
|
List<Join<T,?>> |
getEagerJoins()
Gets the eager joins.
|
Method |
getRevertAttributesToSnapshotMethod()
Gets the method revertAttributesToSnapshot of the persistence object.
|
Method |
getRevertComponentsToSnapshotMethod()
Gets the method revertComponentsToSnapshot of the persistence object.
|
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 permission for a PDO.
|
boolean |
isReadAllowed()
Check the read security for this class in all contexts.
|
boolean |
isReadAllowed(AbstractPersistentObject<?,?> object)
Check the read permission for a PDO.
|
boolean |
isReadAllowed(DomainContext context)
Check the read security for this class.
|
boolean |
isReferenced(Db db,
long id) |
boolean |
isSecurityEnabled() |
boolean |
isViewAllowed(AbstractPersistentObject<?,?> object)
Check the view permission for a PDO.
|
boolean |
isWriteAllowed()
Check the write security for this class in all contexts.
|
boolean |
isWriteAllowed(AbstractPersistentObject<?,?> object)
Check the write permission for a PDO.
|
boolean |
isWriteAllowed(DomainContext context)
Check the write security for this class.
|
String |
toString() |
addReferencingClass, createBacklog, getIdSource, getProperties, getProperty, getRemoteDelegate, getRemoteDelegateId, getVariables, isReferencedImpl, 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 final StatementId selectByNormTextStatementId
AbstractPersistentObject.selectByNormText(java.lang.String).public final StatementId selectByInvertedNormTextStatementId
AbstractPersistentObject.selectByNormText(java.lang.String).public final StatementId selectByNormTextCursorStatementId
AbstractPersistentObject.selectByNormTextAsCursor(java.lang.String).public final StatementId selectByInvertedNormTextCursorStatementId
AbstractPersistentObject.selectByNormTextAsCursor(java.lang.String).public final StatementId selectAllStatementId
AbstractPersistentObject.selectAll().public final StatementId selectAllWithExpiredTableSerialsStatementId
AbstractPersistentObject.selectAllWithExpiredTableSerials(long).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()
public boolean isSecurityEnabled()
public boolean isReferenced(Db db, long id)
isReferenced in class DbObjectClassVariables<P extends AbstractPersistentObject<T,P>>public 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)
Components are readable if their root-entity is readable.
object - the object to check the security rules for.public boolean isWriteAllowed(AbstractPersistentObject<?,?> object)
Only root-entities are writable. Components are not writable by default (because only the root can be persisted).
Notice that the persistence layer will not invoke isWriteAllowed on components, because the root is already checked when saving or deleting a PDO. Remember that only root entities can be persisted by the application!
object - the object to check the security rules for.public boolean isViewAllowed(AbstractPersistentObject<?,?> object)
Components are viewable if their root-entity is viewable.
object - the object to check the security rules for.public boolean isEditAllowed(AbstractPersistentObject<?,?> object)
Only root-entities are editable. Components are not editable by default (because only the root can be persisted).
object - the object to check the security rules for.public Method getCreateAttributesInSnapshotMethod() throws NoSuchMethodException
NoSuchMethodException - if not foundpublic Method getRevertAttributesToSnapshotMethod() throws NoSuchMethodException
NoSuchMethodException - if not foundpublic Method getCreateComponentsInSnapshotMethod() throws NoSuchMethodException
NoSuchMethodException - if not foundpublic Method getRevertComponentsToSnapshotMethod() throws NoSuchMethodException
NoSuchMethodException - if not foundprotected Method findSnapshotMethod(String methodName, Class<?> clazz) throws NoSuchMethodException
AbstractPersistentObject.createAttributesInSnapshot(org.tentackle.persist.AbstractPersistentObject), AbstractPersistentObject.createComponentsInSnapshot(org.tentackle.persist.AbstractPersistentObject),
AbstractPersistentObject.revertAttributesToSnapshot(org.tentackle.persist.AbstractPersistentObject) and AbstractPersistentObject.revertComponentsToSnapshot(org.tentackle.persist.AbstractPersistentObject)) take the snapshot
object with the correct implementation type and are implemented at some implementation class.
This method finds the most specific snapshot-method along the inheritance hierarchy.methodName - the snapshot method nameclazz - the implementation classNoSuchMethodException - if no such method foundprotected int determineReferencePriority(Class<? extends AbstractDbObject<?>> clazz)
Overridden to determine the priority according to the presence of a cache:
determineReferencePriority in class DbObjectClassVariables<P extends AbstractPersistentObject<T,P>>protected boolean checkClassPermission(DomainContext context, Permission permission)
context - the domain contextpermission - the permissionTentackle - distributed, domain- and model-driven