本文整理汇总了Java中org.hibernate.collection.internal.PersistentBag类的典型用法代码示例。如果您正苦于以下问题:Java PersistentBag类的具体用法?Java PersistentBag怎么用?Java PersistentBag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PersistentBag类属于org.hibernate.collection.internal包,在下文中一共展示了PersistentBag类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isLazyInitializedTrue
import org.hibernate.collection.internal.PersistentBag; //导入依赖的package包/类
@Test
public void isLazyInitializedTrue() {
final PersistentBag bag = new PersistentBag() {
private static final long serialVersionUID = 1L;
{
setInitialized();
}
};
Assert.assertTrue(super.isLazyInitialized(bag));
}
示例2: getSerializer
import org.hibernate.collection.internal.PersistentBag; //导入依赖的package包/类
@SuppressWarnings("rawtypes")
@Override
public Serializer getSerializer(Class cl) throws HessianProtocolException{
if (PersistentMap.class.isAssignableFrom(cl) || PersistentBag.class.isAssignableFrom(cl)) {
return serializer ;
}
return super.getSerializer(cl);
}
示例3: postBootHook
import org.hibernate.collection.internal.PersistentBag; //导入依赖的package包/类
@Override
public void postBootHook(AbstractApplicationContext ctx) {
if(ctx.containsBean("xstream")){
XStream xStream = (XStream)ctx.getBean("xstream");
xStream.registerConverter(new HibernateProxyConverter());
xStream.registerConverter(new HibernatePersistentCollectionConverter(xStream.getMapper()));
xStream.alias("list", PersistentList.class);
xStream.alias("list", PersistentBag.class);
xStream.alias("set", PersistentSet.class);
}
}
示例4: instantiate
import org.hibernate.collection.internal.PersistentBag; //导入依赖的package包/类
public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key)
throws HibernateException {
return new PersistentBag(session);
}
示例5: wrap
import org.hibernate.collection.internal.PersistentBag; //导入依赖的package包/类
public PersistentCollection wrap(SessionImplementor session, Object collection) {
return new PersistentBag( session, (Collection) collection );
}
示例6: canConvert
import org.hibernate.collection.internal.PersistentBag; //导入依赖的package包/类
public boolean canConvert(Class type) {
return type == PersistentBag.class;
}
示例7: canConvert
import org.hibernate.collection.internal.PersistentBag; //导入依赖的package包/类
public boolean canConvert(Class clazz) {
return !ClassUtils.isSystemType(clazz) && clazz != PersistentBag.class;
}
示例8: isLazyInitializedFalse
import org.hibernate.collection.internal.PersistentBag; //导入依赖的package包/类
@Test
public void isLazyInitializedFalse() {
Assert.assertFalse(super.isLazyInitialized(new PersistentBag()));
}
示例9: canConvert
import org.hibernate.collection.internal.PersistentBag; //导入依赖的package包/类
public boolean canConvert(final Class type) {
return type == PersistentBag.class
|| type == PersistentList.class
|| type == PersistentSet.class;
}
示例10: isLazyInitialized
import org.hibernate.collection.internal.PersistentBag; //导入依赖的package包/类
/**
* Test a collection is a {@link PersistentBag} and is initialized.
*
* @param bag
* the JPA bag to test.
* @return <code>true</code> if the given collection is a {@link PersistentBag} and is initialized.
*/
protected boolean isLazyInitialized(final Collection<?> bag) {
return bag instanceof PersistentBag && ((PersistentBag) bag).wasInitialized();
}