L - Left end typeR - Right end typepublic abstract static class IndexedLinkManager.Link<L extends Indexed,R extends Indexed> extends DataObject implements Owned
Link objects are pseudo inner classes. We make the manage reference explicit to avoid Link being generic parameterised by itself.
The appropriate LinkManager Link should
always be subclasses to improve type safety. The getLeft()/getRight() methods are
made protected to force us to add sensibly named accessors in sub-classes
DEBUG, recordMAX_IDENTIFIER| Modifier | Constructor and Description |
|---|---|
protected |
Link(IndexedLinkManager<?,L,R> man,
Repository.Record res) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
changeLeft(L left) |
protected void |
changeRight(R right) |
DataObjectFactory |
getFactory() |
protected IndexedLinkManager |
getIndexedLinkManager()
allow sub-classes to get the LinkManager
don't make the return type generic its much easier for sub-classes to implement getFactory() methods
that cast correctly than have a generic signature that can be used use-fully
type checking is preserved by getting the constructor right
|
protected L |
getLeft()
get the Left end object
|
protected java.lang.Number |
getLeftID() |
protected R |
getRight()
get the Right end object
|
protected java.lang.Number |
getRightID() |
boolean |
isLeftPeer(L o) |
boolean |
isRightPeer(R o) |
void |
post_commit(boolean changed)
Extension point called at end of commit
|
protected void |
pre_commit(boolean dirty)
Extension point called at start of commit.
|
void |
release()
This is used like a destructor - means less connections, etc lying around
This will also clear the record from the
Repository cache if this is enabled |
protected void |
setCachedLeft(L o)
pass in a copy of the Left end object to initialise the cache.
|
protected void |
setCachedRight(R o)
pass in a copy of the Right end object to initialise the cache.
|
protected abstract void |
setup()
extension point for Link subclasses this method is called when new
records are created to initialise subclass fields to sensible default
values
|
addToMap, addToMap, addToMap, commit, delete, empty, equals, formUpdate, getContext, getDatabaseService, getFactoryTag, getID, getIdentifier, getIdentifier, getLogger, getMap, getMap, getOwningFactory, getRecord, getRecord, getRecord, getSQLContext, getUniqueIdName, hashCode, isLocked, lock, postCreate, setContents, setDirty, setMap, toStringprotected Link(IndexedLinkManager<?,L,R> man, Repository.Record res)
protected IndexedLinkManager getIndexedLinkManager()
public DataObjectFactory getFactory()
getFactory in interface Ownedpublic void post_commit(boolean changed)
throws DataFault
DataObjectpost_commit in class DataObjectchanged - record was changed by commit.DataFaultpublic void release()
DataObjectRepository cache if this is enabledrelease in interface Releasablerelease in class DataObjectprotected final L getLeft() throws DataException
DataExceptionprotected final java.lang.Number getLeftID()
protected final R getRight() throws DataException
DataExceptionprotected final java.lang.Number getRightID()
public final boolean isLeftPeer(L o)
public final boolean isRightPeer(R o)
protected final void setCachedLeft(L o)
o - DataObjectprotected final void setCachedRight(R o)
o - DataObjectprotected final void changeLeft(L left)
protected final void changeRight(R right)
protected abstract void setup()
throws java.lang.Exception
java.lang.Exceptionprotected void pre_commit(boolean dirty)
throws DataFault
DataObjectpre_commit in class DataObjectdirty - is record known to be modified.DataFault