use of org.hibernate.mapping.OneToOne in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsOneToOne.
@Test
public void testIsOneToOne() {
valueTarget = new SimpleValue();
valueFacade = FACADE_FACTORY.createValue(valueTarget);
Assert.assertFalse(valueFacade.isOneToOne());
OneToOne oneToOne = new OneToOne(null, new RootClass());
valueFacade = FACADE_FACTORY.createValue(oneToOne);
Assert.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 SimpleValue();
valueFacade = FACADE_FACTORY.createValue(simpleValueTarget);
Assert.assertNull(valueFacade.getEntityName());
RootClass pc = new RootClass();
pc.setEntityName("foobar");
OneToOne oneToOneTarget = new OneToOne(null, pc);
valueFacade = FACADE_FACTORY.createValue(oneToOneTarget);
Assert.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 SimpleValue(null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertFalse(valueFacade.isToOne());
ToOne toOne = new OneToOne(null, null, new RootClass());
valueFacade = FACADE_FACTORY.createValue(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);
}
use of org.hibernate.mapping.OneToOne in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsOneToOne.
@Test
public void testIsOneToOne() {
valueTarget = new SimpleValue(null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertFalse(valueFacade.isOneToOne());
OneToOne oneToOne = new OneToOne(null, null, new RootClass(null));
valueFacade = FACADE_FACTORY.createValue(oneToOne);
assertTrue(valueFacade.isOneToOne());
}
Aggregations