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(null, null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertNull(valueFacade.getReferencedEntityName());
valueTarget.setReferencedEntityName("Foo");
assertEquals("Foo", valueFacade.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 ValueFacadeTest method testIsManyToOne.
@Test
public void testIsManyToOne() {
valueTarget = new SimpleValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertFalse(valueFacade.isManyToOne());
ManyToOne manyToOne = new ManyToOne(DummyMetadataBuildingContext.INSTANCE, 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 testSetReferencedEntityName.
@Test
public void testSetReferencedEntityName() {
ManyToOne valueTarget = new ManyToOne(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertNull(valueTarget.getReferencedEntityName());
valueFacade.setReferencedEntityName("Foo");
assertEquals("Foo", valueTarget.getReferencedEntityName());
}
Aggregations