|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jzeno.aop.AutoSyncSession
public class AutoSyncSession
Helper class for autosync functionality. It contains a shadow cache of the elements in the current hibernate session. The hibernate session itself cannot be used for this purpose, because it does not expose the needed functionality.
Constructor Summary | |
---|---|
AutoSyncSession()
|
Method Summary | |
---|---|
void |
addOrReplace(Entity entity)
Add an entity to the session |
void |
clear()
clears the objects that are registered and waiting for autosync should be called after autosync of registered entities |
boolean |
contains(Entity entity)
Check if this entity identified by it's id is present in the current session. |
Entity |
getCurrentSessionEntity(Entity entity)
return the entity registered in the session with the same id as the supplied entity. |
java.util.List |
getEntitiesToDelete()
|
java.util.List |
getEntitiesToSync()
|
boolean |
isNew(Entity entity)
|
boolean |
isRegisteredForSync(Entity e)
|
void |
registerForDelete(Entity entity)
Add an entity for future reference to be autosynchronized This method will be called in the constructor of an AbstractMutableEntity when the CallByValue aspect is deserializing the parameters. |
void |
registerForSync(Entity entity)
Add an entity for future reference to be autosynchronized This method will be called in the constructor of an AbstractMutableEntity when the CallByValue aspect is deserializing the parameters. |
void |
sync()
syncs the current items with the hibernate session |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AutoSyncSession()
Method Detail |
---|
public boolean contains(Entity entity)
entity
-
public Entity getCurrentSessionEntity(Entity entity)
entity
-
public void addOrReplace(Entity entity)
entity
- lockMode
- the session lockmode of the entitypublic void registerForSync(Entity entity)
entity
- public void registerForDelete(Entity entity)
entity
- public java.util.List getEntitiesToSync()
public java.util.List getEntitiesToDelete()
public void clear()
public boolean isNew(Entity entity)
public void sync()
public boolean isRegisteredForSync(Entity e)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |