Java Code Examples for org.hibernate.type.Type.deepCopy()

The following are Jave code examples for showing how to use deepCopy() of the org.hibernate.type.Type class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: lams   File: PersistentIndexedElementHolder.java   View Source Code Vote up 6 votes
@Override
@SuppressWarnings({"unchecked", "deprecation"})
public Serializable getSnapshot(CollectionPersister persister) throws HibernateException {
	final Type elementType = persister.getElementType();
	final String indexNode = getIndexAttributeName( persister );
	final List elements = element.elements( persister.getElementNodeName() );
	final HashMap snapshot = new HashMap( elements.size() );
	for ( int i=0; i<elements.size(); i++ ) {
		final Element elem = (Element) elements.get( i );
		final Object value = elementType.fromXMLNode( elem, persister.getFactory() );
		final Object copy = elementType.deepCopy( value, persister.getFactory() );
		snapshot.put( getIndex( elem, indexNode, i ), copy );
	}
	return snapshot;
	
}