use of org.hibernate.mapping.ManyToOne in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetReferencedEntityName.
@Test
public void testSetReferencedEntityName() {
ManyToOne valueTarget = new ManyToOne(null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
Assert.assertNull(valueTarget.getReferencedEntityName());
valueFacade.setReferencedEntityName("Foo");
Assert.assertEquals("Foo", valueTarget.getReferencedEntityName());
}
use of org.hibernate.mapping.ManyToOne in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewManyToOne.
@Test
public void testNewManyToOne() {
ITable table = service.newTable("foo");
IValue manyToOne = service.newManyToOne(table);
assertNotNull(manyToOne);
Object target = ((IFacade) manyToOne).getTarget();
assertNotNull(target);
assertTrue(target instanceof ManyToOne);
}
use of org.hibernate.mapping.ManyToOne in project jbosstools-hibernate by jbosstools.
the class ServiceImplTest method testNewManyToOne.
@Test
public void testNewManyToOne() {
ITable table = service.newTable("foo");
IValue manyToOne = service.newManyToOne(table);
assertNotNull(manyToOne);
Object target = ((IFacade) manyToOne).getTarget();
assertNotNull(target);
assertTrue(target instanceof ManyToOne);
}
use of org.hibernate.mapping.ManyToOne in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsManyToOne.
@Test
public void testIsManyToOne() {
valueTarget = new SimpleValue(null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertFalse(valueFacade.isManyToOne());
ManyToOne manyToOne = new ManyToOne(null, null);
valueFacade = FACADE_FACTORY.createValue(manyToOne);
assertTrue(valueFacade.isManyToOne());
}
use of org.hibernate.mapping.ManyToOne in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetReferencedEntityName.
@Test
public void testGetReferencedEntityName() {
ManyToOne valueTarget = new ManyToOne(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertNull(valueFacade.getReferencedEntityName());
valueTarget.setReferencedEntityName("Foo");
assertEquals("Foo", valueFacade.getReferencedEntityName());
}
Aggregations