Java 类org.hibernate.persister.collection.BasicCollectionPersister 实例源码

项目:lams    文件:PersistentSortedSet.java   
@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;
}
项目:lams    文件:PersistentSortedMap.java   
@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;
}
项目:cacheonix-core    文件:PersisterFactory.java   
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);
    }

}
项目:cacheonix-core    文件:PersistentSortedSet.java   
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;
}
项目:cacheonix-core    文件:PersistentSortedMap.java   
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;
}
项目:lams    文件:StandardPersisterClassResolver.java   
private Class<BasicCollectionPersister> basicCollectionPersister() {
    return BasicCollectionPersister.class;
}