org.hibernate.persister.collection.BasicCollectionPersister Java Examples

The following examples show how to use org.hibernate.persister.collection.BasicCollectionPersister. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: PersistentSortedSet.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@SuppressWarnings({"unchecked", "UnusedParameters"})
protected Serializable snapshot(BasicCollectionPersister persister, EntityMode entityMode)
		throws HibernateException {
	final TreeMap clonedSet = new TreeMap( comparator );
	for ( Object setElement : set ) {
		final Object copy = persister.getElementType().deepCopy( setElement, persister.getFactory() );
		clonedSet.put( copy, copy );
	}
	return clonedSet;
}
 
Example #2
Source File: PersistentSortedMap.java    From lams with GNU General Public License v2.0 5 votes vote down vote up
@SuppressWarnings({"unchecked", "UnusedParameters"})
protected Serializable snapshot(BasicCollectionPersister persister, EntityMode entityMode) throws HibernateException {
	final TreeMap clonedMap = new TreeMap( comparator );
	for ( Object o : map.entrySet() ) {
		final Entry e = (Entry) o;
		clonedMap.put( e.getKey(), persister.getElementType().deepCopy( e.getValue(), persister.getFactory() ) );
	}
	return clonedMap;
}
 
Example #3
Source File: PersisterFactory.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static CollectionPersister createCollectionPersister(Configuration cfg, Collection model, CacheConcurrencyStrategy cache, SessionFactoryImplementor factory)
throws HibernateException {
	Class persisterClass = model.getCollectionPersisterClass();
	if(persisterClass==null) { // default behavior
		return model.isOneToMany() ?
			(CollectionPersister) new OneToManyPersister(model, cache, cfg, factory) :
			(CollectionPersister) new BasicCollectionPersister(model, cache, cfg, factory);
	}
	else {
		return create(persisterClass, cfg, model, cache, factory);
	}

}
 
Example #4
Source File: PersistentSortedSet.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
protected Serializable snapshot(BasicCollectionPersister persister, EntityMode entityMode) 
throws HibernateException {
	//if (set==null) return new Set(session);
	TreeMap clonedSet = new TreeMap(comparator);
	Iterator iter = set.iterator();
	while ( iter.hasNext() ) {
		Object copy = persister.getElementType().deepCopy( iter.next(), entityMode, persister.getFactory() );
		clonedSet.put(copy, copy);
	}
	return clonedSet;
}
 
Example #5
Source File: PersistentSortedMap.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
protected Serializable snapshot(BasicCollectionPersister persister, EntityMode entityMode) throws HibernateException {
	TreeMap clonedMap = new TreeMap(comparator);
	Iterator iter = map.entrySet().iterator();
	while ( iter.hasNext() ) {
		Map.Entry e = (Map.Entry) iter.next();
		clonedMap.put( e.getKey(), persister.getElementType().deepCopy( e.getValue(), entityMode, persister.getFactory() ) );
	}
	return clonedMap;
}
 
Example #6
Source File: StandardPersisterClassResolver.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
private Class<BasicCollectionPersister> basicCollectionPersister() {
	return BasicCollectionPersister.class;
}