use of org.hibernate.mapping.Collection in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetFetchModeJoin.
@Test
public void testSetFetchModeJoin() {
SimpleValue simpleValueTarget = new SimpleValue(null);
assertNotEquals(FetchMode.JOIN, simpleValueTarget.getFetchMode());
valueFacade = FACADE_FACTORY.createValue(simpleValueTarget);
valueFacade.setFetchModeJoin();
assertNotEquals(FetchMode.JOIN, simpleValueTarget.getFetchMode());
Collection collectionTarget = new Bag(null, null);
assertNotEquals(FetchMode.JOIN, collectionTarget.getFetchMode());
valueFacade = FACADE_FACTORY.createValue(collectionTarget);
valueFacade.setFetchModeJoin();
assertEquals(FetchMode.JOIN, collectionTarget.getFetchMode());
ManyToOne manyToOneTarget = new ManyToOne(null, null);
assertNotEquals(FetchMode.JOIN, manyToOneTarget.getFetchMode());
valueFacade = FACADE_FACTORY.createValue(manyToOneTarget);
valueFacade.setFetchModeJoin();
assertEquals(FetchMode.JOIN, manyToOneTarget.getFetchMode());
}
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(null);
IValue keyValueFacade = FACADE_FACTORY.createValue(keyValueTarget);
Collection collectionTarget = new Bag(null, null);
IValue collectionFacade = FACADE_FACTORY.createValue(collectionTarget);
assertNull(collectionTarget.getKey());
collectionFacade.setKey(keyValueFacade);
assertSame(keyValueTarget, collectionTarget.getKey());
}
use of org.hibernate.mapping.Collection in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetRole.
@Test
public void testSetRole() {
Collection collectionTarget = new Bag(null, null);
valueFacade = FACADE_FACTORY.createValue(collectionTarget);
assertNull(collectionTarget.getRole());
valueFacade.setRole("foobar");
assertEquals("foobar", collectionTarget.getRole());
}
use of org.hibernate.mapping.Collection in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsInverse.
@Test
public void testIsInverse() {
Collection collectionTarget = new Bag(null, null);
valueFacade = FACADE_FACTORY.createValue(collectionTarget);
assertFalse(valueFacade.isInverse());
collectionTarget.setInverse(true);
assertTrue(valueFacade.isInverse());
}
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(null, null);
valueFacade = FACADE_FACTORY.createValue(collectionTarget);
valueFacade.setLazy(true);
assertTrue(collectionTarget.isLazy());
valueFacade.setLazy(false);
assertFalse(collectionTarget.isLazy());
}
Aggregations