use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetTable.
@Test
public void testGetTable() {
Table tableTarget = new Table();
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE, tableTarget);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
ITable tableFacade = valueFacade.getTable();
assertSame(tableTarget, ((IFacade) tableFacade).getTarget());
}
use of org.hibernate.mapping.BasicValue 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.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsTypeSpecified.
@Test
public void testIsTypeSpecified() {
SimpleValue valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isTypeSpecified());
valueTarget.setTypeName("org.foo.Bar");
assertTrue(valueFacade.isTypeSpecified());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class TableFacadeTest method testGetIdentifierValue.
@Test
public void testGetIdentifierValue() {
Table table = new Table();
ITable tableFacade = new AbstractTableFacade(FACADE_FACTORY, table) {
};
IValue valueFacade = tableFacade.getIdentifierValue();
assertNull(valueFacade);
KeyValue value = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
table.setIdentifierValue(value);
valueFacade = tableFacade.getIdentifierValue();
assertSame(value, ((IFacade) valueFacade).getTarget());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetCollectionElement.
@Test
public void testGetCollectionElement() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
IValue collectionElement = valueFacade.getCollectionElement();
assertNull(collectionElement);
Set set = new Set(DummyMetadataBuildingContext.INSTANCE, null);
set.setElement(valueTarget);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, set) {
};
collectionElement = valueFacade.getCollectionElement();
assertNotNull(collectionElement);
assertSame(valueTarget, ((IFacade) collectionElement).getTarget());
}
Aggregations