下面列出了怎么用org.hibernate.collection.internal.PersistentBag的API类实例代码及写法,或者点击链接到github查看源代码。
@Override
public boolean canConvert(@SuppressWarnings("rawtypes") Class clazz) {
return super.canConvert(clazz) || clazz == PersistentBag.class;
}
@Override
public PersistentCollection instantiate(SharedSessionContractImplementor session, CollectionPersister persister, Serializable key)
throws HibernateException {
return new PersistentBag( session );
}
@Override
public PersistentCollection wrap(SharedSessionContractImplementor session, Object collection) {
return new PersistentBag( session, (Collection) collection );
}
@Override
public boolean canConvert(final Class type) {
return PersistentBag.class == type || PersistentList.class == type || PersistentSet.class == type;
}