Java源码示例:org.hibernate.collection.PersistentMap
示例1
public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key) {
if ( session.getEntityMode()==EntityMode.DOM4J ) {
return new PersistentMapElementHolder(session, persister, key);
}
else {
return new PersistentMap(session);
}
}
示例2
public PersistentCollection wrap(SessionImplementor session, Object collection) {
if ( session.getEntityMode()==EntityMode.DOM4J ) {
return new PersistentMapElementHolder( session, (Element) collection );
}
else {
return new PersistentMap( session, (java.util.Map) collection );
}
}
示例3
public void init()
{
collectionMap.put(PersistentBag.class, ArrayList.class);
collectionMap.put(PersistentList.class, ArrayList.class);
collectionMap.put(PersistentMap.class, HashMap.class);
collectionMap.put(PersistentSet.class, HashSet.class);
collectionMap.put(PersistentSortedMap.class, TreeMap.class);
collectionMap.put(PersistentSortedSet.class, TreeSet.class);
}