|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.hibernate4gwt.core.LazyKiller
public class LazyKiller
This class replaces all "lazy but not loaded" Hibernate association with null to allow the argument POJO to be used in other libraries without additional loading of 'LazyInitializationException'. The lazy properties are stored as string. They can be reused for "reattaching" the clone pojo to a fresh Hibernate object.
Constructor Summary | |
---|---|
LazyKiller()
Empty constructor |
|
LazyKiller(IClassMapper classMapper,
IPersistenceUtil persistenceUtil,
IPojoStore pojoStore)
Base constructor |
Method Summary | |
---|---|
void |
attach(java.lang.Object hibernatePojo,
java.lang.Object clonePojo)
Hibernate attachment |
protected java.lang.Object |
clone(java.lang.Object hibernatePojo,
java.lang.Class cloneClass)
Clone the abstract POJO with BeanLib Every time a lazy property is detected, it is replaced with null. |
java.lang.Object |
detach(java.lang.Object hibernatePojo)
Hibernate detachment |
java.lang.Object |
detach(java.lang.Object hibernatePojo,
java.lang.Class cloneClass)
Hibernate detachment |
IPersistenceUtil |
getPersistenceUtil()
|
IPojoStore |
getPojoStore()
|
void |
populate(java.lang.Object hibernatePojo,
java.lang.Object clonePojo)
Populate the hibernatePojo (a fresh new one or the one used to clone) with the clone detached object. |
void |
setClassMapper(IClassMapper mapper)
|
void |
setPersistenceUtil(IPersistenceUtil util)
|
void |
setPojoStore(IPojoStore store)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LazyKiller()
public LazyKiller(IClassMapper classMapper, IPersistenceUtil persistenceUtil, IPojoStore pojoStore)
classMapper
- the class mapping servicepersistenceUtil
- persistence util implementation
- Method Detail |
---|
public IPersistenceUtil getPersistenceUtil()
public void setPersistenceUtil(IPersistenceUtil util)
util
- the persistenceUtil to setpublic void setClassMapper(IClassMapper mapper)
mapper
- the class Mapper to setpublic IPojoStore getPojoStore()
public void setPojoStore(IPojoStore store)
store
- the POJO Store to setpublic java.lang.Object detach(java.lang.Object hibernatePojo)
hibernatePojo
- the input hibernate pojo
public java.lang.Object detach(java.lang.Object hibernatePojo, java.lang.Class cloneClass)
hibernatePojo
- the input hibernate pojo
public void attach(java.lang.Object hibernatePojo, java.lang.Object clonePojo)
hibernatePojo
- the stored or fresh Hibernate POJOclonePojo
- the cloned pojoprotected java.lang.Object clone(java.lang.Object hibernatePojo, java.lang.Class cloneClass)
pojo
-
public void populate(java.lang.Object hibernatePojo, java.lang.Object clonePojo)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |