Java 类org.hibernate.collection.internal.PersistentBag 实例源码

项目:bootstrap    文件:TestAbstractJpaTest.java   
@Test
public void isLazyInitializedTrue() {
    final PersistentBag bag = new PersistentBag() {
        private static final long serialVersionUID = 1L;

        {
            setInitialized();
        }
    };
    Assert.assertTrue(super.isLazyInitialized(bag));
}
项目:dubbo-demo    文件:MyHessian2SerializerFactory.java   
@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);
}
项目:kordapt    文件:HibernateCoreAddon.java   
@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);
    }

}
项目:lams    文件:BagType.java   
public PersistentCollection instantiate(SessionImplementor session, CollectionPersister persister, Serializable key)
throws HibernateException {
    return new PersistentBag(session);
}
项目:lams    文件:BagType.java   
public PersistentCollection wrap(SessionImplementor session, Object collection) {
    return new PersistentBag( session, (Collection) collection );
}
项目:gitplex-mit    文件:PersistentBagConverter.java   
public boolean canConvert(Class type) {
    return type == PersistentBag.class;
}
项目:gitplex-mit    文件:JpaConverter.java   
public boolean canConvert(Class clazz) {
    return !ClassUtils.isSystemType(clazz) && clazz != PersistentBag.class;
}
项目:bootstrap    文件:TestAbstractJpaTest.java   
@Test
public void isLazyInitializedFalse() {
    Assert.assertFalse(super.isLazyInitialized(new PersistentBag()));
}
项目:kordapt    文件:HibernatePersistentCollectionConverter.java   
public boolean canConvert(final Class type) {
    return type == PersistentBag.class
            || type == PersistentList.class
            || type == PersistentSet.class;
}
项目:bootstrap    文件:AbstractJpaTest.java   
/**
 * 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();
}