org.granite.hibernate4
Class HibernateExternalizer
java.lang.Object
org.granite.messaging.amf.io.util.externalizer.DefaultExternalizer
org.granite.hibernate4.HibernateExternalizer
- All Implemented Interfaces:
- Externalizer
public class HibernateExternalizer
- extends DefaultExternalizer
- Author:
- Franck WOLFF
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HibernateExternalizer
public HibernateExternalizer()
configure
public void configure(XMap properties)
- Configure this externalizer with the values supplied in granite-config.xml.
The only supported configuration option is 'hibernate-collection-metadata' with
values in ['no' (default), 'yes' and 'lazy']. By default, collection metadata (key,
role and snapshot) aren't serialized. If the value of the 'hibernate-collection-metadata'
node is 'yes', metadata will be always serialized, while the 'lazy' value tells the
externalizer to serialiaze metadata for uninitialized collections only.
Configuration example (granite-config.xml):
<granite-config scan="true">
<externalizers>
<configuration>
<hibernate-collection-metadata>lazy</hibernate-collection-metadata>
</configuration>
</externalizers>
</granite-config>
- Specified by:
configure in interface Externalizer- Overrides:
configure in class DefaultExternalizer
- Parameters:
properties - an XMap instance that contains the configuration node.
newInstance
public Object newInstance(String type,
ObjectInput in)
throws IOException,
ClassNotFoundException,
InstantiationException,
InvocationTargetException,
IllegalAccessException
- Specified by:
newInstance in interface Externalizer- Overrides:
newInstance in class DefaultExternalizer
- Throws:
IOException
ClassNotFoundException
InstantiationException
InvocationTargetException
IllegalAccessException
newProxyInstantiator
protected Object newProxyInstantiator(ConcurrentHashMap<String,ProxyFactory> proxyFactories,
String detachedState)
readExternal
public void readExternal(Object o,
ObjectInput in)
throws IOException,
ClassNotFoundException,
IllegalAccessException
- Specified by:
readExternal in interface Externalizer- Overrides:
readExternal in class DefaultExternalizer
- Throws:
IOException
ClassNotFoundException
IllegalAccessException
newHibernateCollection
protected org.hibernate.collection.spi.PersistentCollection newHibernateCollection(AbstractExternalizablePersistentCollection value,
Property field)
writeExternal
public void writeExternal(Object o,
ObjectOutput out)
throws IOException,
IllegalAccessException
- Specified by:
writeExternal in interface Externalizer- Overrides:
writeExternal in class DefaultExternalizer
- Throws:
IOException
IllegalAccessException
newExternalizableCollection
protected AbstractExternalizablePersistentCollection newExternalizableCollection(org.hibernate.collection.spi.PersistentCollection value)
accept
public int accept(Class<?> clazz)
- Specified by:
accept in interface Externalizer- Overrides:
accept in class DefaultExternalizer
getProxyDetachedState
protected String getProxyDetachedState(HibernateProxy proxy)
isRegularEntity
protected boolean isRegularEntity(Class<?> clazz)
isEmbeddable
protected boolean isEmbeddable(Class<?> clazz)
serializeSerializable
protected byte[] serializeSerializable(Serializable o)
deserializeSerializable
protected Serializable deserializeSerializable(byte[] data)