use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class FacadeFactoryTest method testCreatePersistentClass.
@Test
public void testCreatePersistentClass() {
PersistentClass persistentClass = new RootClass(null);
IPersistentClass facade = facadeFactory.createPersistentClass(persistentClass);
assertTrue(facade instanceof PersistentClassFacadeImpl);
assertSame(persistentClass, ((IFacade) facade).getTarget());
}
use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class HibernateMappingExporterExtensionTest method createPojoClass.
private POJOClass createPojoClass() {
RootClass persistentClass = new RootClass(null);
Table rootTable = new Table();
rootTable.setName("table");
persistentClass.setTable(rootTable);
persistentClass.setEntityName("Bar");
persistentClass.setClassName("foo.Bar");
return new EntityPOJOClass(persistentClass, new Cfg2JavaTool());
}
use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class SpecialRootClassFacadeTest method beforeEach.
@BeforeEach
public void beforeEach() {
PersistentClass persistentClassTarget = new RootClass();
Property propertyTarget = new Property();
propertyTarget.setPersistentClass(persistentClassTarget);
specialRootClassFacade = new SpecialRootClassFacadeImpl(FACADE_FACTORY, FACADE_FACTORY.createProperty(propertyTarget));
}
use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class TypeFacadeTest method testIsComponentType.
@Test
public void testIsComponentType() {
IType typeFacade = null;
ClassType classType = new ClassType();
typeFacade = FACADE_FACTORY.createType(classType);
assertFalse(typeFacade.isComponentType());
StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder();
ssrb.applySetting(AvailableSettings.DIALECT, TestDialect.class.getName());
StandardServiceRegistry ssr = ssrb.build();
MetadataBuildingOptions mdbo = new MetadataBuilderImpl.MetadataBuildingOptionsImpl(ssr);
MetadataImplementor mdi = (MetadataImplementor) new MetadataBuilderImpl(new MetadataSources(ssr)).build();
ComponentType componentType = new ComponentType(null, new ComponentMetamodel(new Component(mdi, new RootClass(null)), mdbo));
typeFacade = FACADE_FACTORY.createType(componentType);
assertTrue(typeFacade.isComponentType());
}
use of org.hibernate.mapping.RootClass in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetAssociatedClass.
@Test
public void testGetAssociatedClass() {
RootClass rootClass = new RootClass(null);
OneToMany oneToManyTarget = new OneToMany(null, null);
valueFacade = FACADE_FACTORY.createValue(oneToManyTarget);
assertNull(valueFacade.getAssociatedClass());
oneToManyTarget.setAssociatedClass(rootClass);
assertSame(rootClass, ((IFacade) valueFacade.getAssociatedClass()).getTarget());
}
Aggregations