Class AbstractPersistentObjectRemoteDelegateImpl<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
java.lang.Object
org.tentackle.dbms.trip.RemoteDbDelegateImpl<P>
org.tentackle.dbms.trip.AbstractDbObjectRemoteDelegateImpl<P>
org.tentackle.persist.trip.AbstractPersistentObjectRemoteDelegateImpl<T,P>
- Type Parameters:
T- thePersistentDomainObjectclassP- theAbstractPersistentObjectclass (persistence implementation)
- All Implemented Interfaces:
AbstractDbObjectRemoteDelegate<P>, RemoteDbDelegate, AbstractPersistentObjectRemoteDelegate<T,P>, org.tentackle.trip.Remote
- Direct Known Subclasses:
NumberPoolRemoteDelegateImpl, NumberRangeRemoteDelegateImpl, SecurityRemoteDelegateImpl
public class AbstractPersistentObjectRemoteDelegateImpl<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
extends AbstractDbObjectRemoteDelegateImpl<P>
implements AbstractPersistentObjectRemoteDelegate<T,P>
Implementation of the remote delegate for
PersistentDomainObject.- Author:
- harald
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected TPDO with a default domain context associated to the delegate's session.The PDO interface class.Fields inherited from class AbstractDbObjectRemoteDelegateImpl
dbObject -
Constructor Summary
ConstructorsConstructorDescriptionAbstractPersistentObjectRemoteDelegateImpl(RemoteDbSessionImpl serverSession, Class<P> persistenceClass, Class<T> pdoClass) Creates a delegate on the serverSession socket. -
Method Summary
Modifier and TypeMethodDescriptioncreateRemoteResultSetCursorDelegate(org.tentackle.misc.ScrollableResource<T> cursor) Creates and exports a remote cursor delegate for a local cursor.longdeleteImpl(T obj) deleteObject(P obj) voiddeletePlain(long id, long serial) voiddummyUpdate(P obj) protected PgetPersistenceDelegate(T pDo) Gets the persistence delegate from a PDO.voidinsertObject(P obj) voidinsertPlain(P obj) booleanisReferenced(long id) booleanisReferenced(DomainContext cb, long id) protected TnewInstance(DomainContext context) Creates a new pdo instance of the required class for methods that return a new object.protected TnewInstance(DomainContext context, long id) Selects by ID into a new instance.
ThrowsNotFoundException, if no such PDO in database.persistImpl(T obj) persistObject(P obj) longsaveObject(P obj) select(DomainContext cb, long id, boolean forUpdate, boolean tokenLocked) List<org.tentackle.misc.IdSerialTuple> selectAllWithExpiredTableSerials(DomainContext cb, long oldSerial) selectAllWithExpiredTableSerials(DomainContext cb, long oldSerial, long maxSerial) selectAny(DomainContext cb, Collection<Long> ids) selectAnyForCache(DomainContext cb, Collection<Long> ids) selectByNormText(DomainContext cb, String normText) selectByNormTextAsCursor(DomainContext cb, String normText) selectForCache(DomainContext cb, long id) selectLatest(DomainContext cb, long greaterId, int limit) selectObject(long id) selectObjectForUpdate(long id) selectTokenLocked(DomainContext cb, long id) protected voidsetDomainContext(DomainContext context) Sets the domain context in the default object.transferTokenLock(T pdo, long userId) voidupdateAndSetSerial(long id, long serial) updateObject(P obj) voidupdatePlain(P obj) voidupdateSerial(long id, long serial) voidupdateSerialAndTableSerial(long id, long serial, long tableSerial) updateTokenLock(DomainContext cb, long id, org.tentackle.common.Timestamp tokenExpiry, long userId, org.tentackle.common.Timestamp curTime) voidupdateTokenLockOnly(DomainContext cb, long id, long editedBy, org.tentackle.common.Timestamp editedSince, org.tentackle.common.Timestamp editedExpiry) Methods inherited from class AbstractDbObjectRemoteDelegateImpl
countModification, getExpiredTableSerials, newInstance, obtainReservedId, selectExpiredTableSerials, selectExpiredTableSerials, selectMaxId, selectMaxTableSerial, selectObjectsWithExpiredTableSerials, selectSerial, validateMethods inherited from class RemoteDbDelegateImpl
getServerSession, getServicedClass, getSession, toString
-
Field Details
-
pdoClass
The PDO interface class. -
pdo
PDO with a default domain context associated to the delegate's session.
-
-
Constructor Details
-
AbstractPersistentObjectRemoteDelegateImpl
public AbstractPersistentObjectRemoteDelegateImpl(RemoteDbSessionImpl serverSession, Class<P> persistenceClass, Class<T> pdoClass) Creates a delegate on the serverSession socket.- Parameters:
serverSession- the TRIP sessionpersistenceClass- the subclass of AbstractDbObjectpdoClass- the PDO class (interface)
-
-
Method Details
-
initialize
public void initialize()- Overrides:
initializein classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
newInstance
Creates a new pdo instance of the required class for methods that return a new object.- Parameters:
context- the domain context- Returns:
- the new pdo
-
newInstance
Selects by ID into a new instance.
ThrowsNotFoundException, if no such PDO in database.- Parameters:
context- the domain contextid- the ID- Returns:
- the pdo, never null
-
getPersistenceDelegate
-
setDomainContext
Sets the domain context in the default object.- Parameters:
context- the domain context
-
selectObject
- Specified by:
selectObjectin interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
selectObjectin classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
selectObjectForUpdate
- Specified by:
selectObjectForUpdatein interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
selectObjectForUpdatein classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
selectAllObjects
- Specified by:
selectAllObjectsin interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
selectAllObjectsin classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
dummyUpdate
- Specified by:
dummyUpdatein interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
dummyUpdatein classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
updateSerial
public void updateSerial(long id, long serial) - Specified by:
updateSerialin interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
updateSerialin classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
updateAndSetSerial
public void updateAndSetSerial(long id, long serial) - Specified by:
updateAndSetSerialin interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
updateAndSetSerialin classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
updateSerialAndTableSerial
public void updateSerialAndTableSerial(long id, long serial, long tableSerial) - Specified by:
updateSerialAndTableSerialin interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
updateSerialAndTableSerialin classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
updatePlain
- Specified by:
updatePlainin interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
updatePlainin classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
deletePlain
public void deletePlain(long id, long serial) - Specified by:
deletePlainin interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
deletePlainin classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
insertPlain
- Specified by:
insertPlainin interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
insertPlainin classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
updateObject
- Specified by:
updateObjectin interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
updateObjectin classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
insertObject
- Specified by:
insertObjectin interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
insertObjectin classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
deleteObject
- Specified by:
deleteObjectin interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
deleteObjectin classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
persistObject
- Specified by:
persistObjectin interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
persistObjectin classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
saveObject
- Specified by:
saveObjectin interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
saveObjectin classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
isReferenced
public boolean isReferenced(long id) - Specified by:
isReferencedin interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
isReferencedin classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
selectAllIdSerial
- Specified by:
selectAllIdSerialin interfaceAbstractDbObjectRemoteDelegate<T extends PersistentDomainObject<T>>- Overrides:
selectAllIdSerialin classAbstractDbObjectRemoteDelegateImpl<P extends AbstractPersistentObject<T,P>>
-
persistImpl
- Specified by:
persistImplin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
saveImpl
- Specified by:
saveImplin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
deleteImpl
- Specified by:
deleteImplin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
selectAll
- Specified by:
selectAllin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
selectAny
- Specified by:
selectAnyin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
select
- Specified by:
selectin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
selectTokenLocked
- Specified by:
selectTokenLockedin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
selectByNormText
- Specified by:
selectByNormTextin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
selectByNormTextAsCursor
- Specified by:
selectByNormTextAsCursorin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
selectLatest
- Specified by:
selectLatestin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
selectAllForCache
- Specified by:
selectAllForCachein interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
selectAnyForCache
- Specified by:
selectAnyForCachein interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
selectForCache
- Specified by:
selectForCachein interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
selectAllAsCursor
- Specified by:
selectAllAsCursorin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
selectAllWithExpiredTableSerials
- Specified by:
selectAllWithExpiredTableSerialsin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
selectAllWithExpiredTableSerials
- Specified by:
selectAllWithExpiredTableSerialsin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
isReferenced
- Specified by:
isReferencedin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
updateTokenLock
public TokenLockInfo updateTokenLock(DomainContext cb, long id, org.tentackle.common.Timestamp tokenExpiry, long userId, org.tentackle.common.Timestamp curTime) - Specified by:
updateTokenLockin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
transferTokenLock
- Specified by:
transferTokenLockin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
updateTokenLockOnly
public void updateTokenLockOnly(DomainContext cb, long id, long editedBy, org.tentackle.common.Timestamp editedSince, org.tentackle.common.Timestamp editedExpiry) - Specified by:
updateTokenLockOnlyin interfaceAbstractPersistentObjectRemoteDelegate<T extends PersistentDomainObject<T>, P extends AbstractPersistentObject<T,P>>
-
createRemoteResultSetCursorDelegate
public RemoteResultSetCursor<T> createRemoteResultSetCursorDelegate(org.tentackle.misc.ScrollableResource<T> cursor) Creates and exports a remote cursor delegate for a local cursor.- Parameters:
cursor- the local cursor- Returns:
- the remote cursor delegate
-