use of org.hibernate.mapping.Collection in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetCollectionTable.
@Test
public void testGetCollectionTable() {
Table tableTarget = new Table();
Collection valueTarget = new Set(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertNull(valueFacade.getCollectionTable());
valueTarget.setCollectionTable(tableTarget);
assertSame(tableTarget, ((IFacade) valueFacade.getCollectionTable()).getTarget());
}
use of org.hibernate.mapping.Collection in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetCollectionTable.
@Test
public void testSetCollectionTable() {
Table tableTarget = new Table();
ITable tableFacade = FACADE_FACTORY.createTable(tableTarget);
Collection valueTarget = new Set(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertNull(valueTarget.getCollectionTable());
valueFacade.setCollectionTable(tableFacade);
assertSame(tableTarget, valueTarget.getCollectionTable());
}
use of org.hibernate.mapping.Collection in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetLazy.
@Test
public void testSetLazy() {
Collection collectionTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = FACADE_FACTORY.createValue(collectionTarget);
valueFacade.setLazy(true);
assertTrue(collectionTarget.isLazy());
valueFacade.setLazy(false);
assertFalse(collectionTarget.isLazy());
}
use of org.hibernate.mapping.Collection in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testGetCollectionTable.
@Test
public void testGetCollectionTable() {
Table tableTarget = new Table();
Collection valueTarget = new Set(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = FACADE_FACTORY.createValue(valueTarget);
assertNull(valueFacade.getCollectionTable());
valueTarget.setCollectionTable(tableTarget);
assertSame(tableTarget, ((IFacade) valueFacade.getCollectionTable()).getTarget());
}
use of org.hibernate.mapping.Collection in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetKey.
@Test
public void testSetKey() {
KeyValue keyValueTarget = new SimpleValue(DummyMetadataBuildingContext.INSTANCE, null);
IValue keyValueFacade = FACADE_FACTORY.createValue(keyValueTarget);
Collection collectionTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
IValue collectionFacade = FACADE_FACTORY.createValue(collectionTarget);
assertNull(collectionTarget.getKey());
collectionFacade.setKey(keyValueFacade);
assertSame(keyValueTarget, collectionTarget.getKey());
}
Aggregations