use of org.hibernate.mapping.OneToOne in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetEntityName.
@Test
public void testGetEntityName() {
SimpleValue simpleValueTarget = new SimpleValue(null);
valueFacade = FACADE_FACTORY.createValue(simpleValueTarget);
assertNull(valueFacade.getEntityName());
RootClass pc = new RootClass(null);
pc.setEntityName("foobar");
OneToOne oneToOneTarget = new OneToOne(null, null, pc);
valueFacade = FACADE_FACTORY.createValue(oneToOneTarget);
assertEquals("foobar", valueFacade.getEntityName());
}
use of org.hibernate.mapping.OneToOne in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsOneToOne.
@Test
public void testIsOneToOne() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isOneToOne());
OneToOne oneToOne = new OneToOne(DummyMetadataBuildingContext.INSTANCE, null, new RootClass(DummyMetadataBuildingContext.INSTANCE));
valueFacade = new AbstractValueFacade(FACADE_FACTORY, oneToOne) {
};
assertTrue(valueFacade.isOneToOne());
}
use of org.hibernate.mapping.OneToOne in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetEntityName.
@Test
public void testGetEntityName() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertNull(valueFacade.getEntityName());
RootClass pc = new RootClass(DummyMetadataBuildingContext.INSTANCE);
pc.setEntityName("foobar");
OneToOne oneToOneTarget = new OneToOne(DummyMetadataBuildingContext.INSTANCE, null, pc);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, oneToOneTarget) {
};
assertEquals("foobar", valueFacade.getEntityName());
}
use of org.hibernate.mapping.OneToOne in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsToOne.
@Test
public void testIsToOne() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isToOne());
ToOne toOne = new OneToOne(DummyMetadataBuildingContext.INSTANCE, null, new RootClass(DummyMetadataBuildingContext.INSTANCE));
valueFacade = new AbstractValueFacade(FACADE_FACTORY, toOne) {
};
assertTrue(valueFacade.isToOne());
}
use of org.hibernate.mapping.OneToOne in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewOneToOne.
@Test
public void testNewOneToOne() {
IPersistentClass persistentClass = service.newRootClass();
IValue oneToOne = service.newOneToOne(persistentClass);
assertNotNull(oneToOne);
Object target = ((IFacade) oneToOne).getTarget();
assertNotNull(target);
assertTrue(target instanceof OneToOne);
}
Aggregations