use of org.hibernate.metadata.CollectionMetadata in project jbosstools-hibernate by jbosstools.
the class CollectionMetadataFacadeTest method setUp.
@Before
public void setUp() {
CollectionMetadata target = (CollectionMetadata) Proxy.newProxyInstance(FACADE_FACTORY.getClassLoader(), new Class[] { CollectionMetadata.class }, new TestInvocationHandler());
collectionMetadata = new AbstractCollectionMetadataFacade(FACADE_FACTORY, target) {
};
}
use of org.hibernate.metadata.CollectionMetadata in project jbosstools-hibernate by jbosstools.
the class CollectionMetadataFacadeTest method setUp.
@Before
public void setUp() {
CollectionMetadata target = (CollectionMetadata) Proxy.newProxyInstance(FACADE_FACTORY.getClassLoader(), new Class[] { CollectionMetadata.class }, new TestInvocationHandler());
collectionMetadata = new AbstractCollectionMetadataFacade(FACADE_FACTORY, target) {
};
}
use of org.hibernate.metadata.CollectionMetadata in project jbosstools-hibernate by jbosstools.
the class SessionFactoryFacadeTest method testGetCollectionMetadata.
@Test
public void testGetCollectionMetadata() {
Configuration configuration = new Configuration();
configuration.addClass(Foo.class);
SessionFactory sessionFactory = configuration.buildSessionFactory(new StandardServiceRegistryBuilder().build());
ISessionFactory sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
CollectionMetadata collectionMetadata = sessionFactory.getCollectionMetadata("org.jboss.tools.hibernate.runtime.v_5_1.internal.test.Foo.bars");
Assert.assertSame(collectionMetadata, ((IFacade) sessionFactoryFacade.getCollectionMetadata("org.jboss.tools.hibernate.runtime.v_5_1.internal.test.Foo.bars")).getTarget());
}
use of org.hibernate.metadata.CollectionMetadata in project jbosstools-hibernate by jbosstools.
the class SessionFactoryFacadeTest method testGetCollectionMetadata.
@Test
public void testGetCollectionMetadata() {
Configuration configuration = new Configuration();
configuration.addClass(Foo.class);
SessionFactory sessionFactory = configuration.buildSessionFactory(new StandardServiceRegistryBuilder().build());
ISessionFactory sessionFactoryFacade = FACADE_FACTORY.createSessionFactory(sessionFactory);
Metamodel metamodel = ((EntityManagerFactory) sessionFactory).getMetamodel();
CollectionMetadata collectionMetadata = (CollectionMetadata) ((MetamodelImplementor) metamodel).collectionPersister("org.jboss.tools.hibernate.runtime.v_5_3.internal.test.Foo.bars");
Assert.assertSame(collectionMetadata, ((IFacade) sessionFactoryFacade.getCollectionMetadata("org.jboss.tools.hibernate.runtime.v_5_3.internal.test.Foo.bars")).getTarget());
}
Aggregations