use of org.hibernate.mapping.ManyToOne in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetFetchModeJoin.
@Test
public void testSetFetchModeJoin() {
SimpleValue simpleValueTarget = new SimpleValue(DummyMetadataBuildingContext.INSTANCE);
assertNotEquals(FetchMode.JOIN, simpleValueTarget.getFetchMode());
valueFacade = FACADE_FACTORY.createValue(simpleValueTarget);
valueFacade.setFetchModeJoin();
assertNotEquals(FetchMode.JOIN, simpleValueTarget.getFetchMode());
Collection collectionTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
assertNotEquals(FetchMode.JOIN, collectionTarget.getFetchMode());
valueFacade = FACADE_FACTORY.createValue(collectionTarget);
valueFacade.setFetchModeJoin();
assertEquals(FetchMode.JOIN, collectionTarget.getFetchMode());
ManyToOne manyToOneTarget = new ManyToOne(DummyMetadataBuildingContext.INSTANCE, null);
assertNotEquals(FetchMode.JOIN, manyToOneTarget.getFetchMode());
valueFacade = FACADE_FACTORY.createValue(manyToOneTarget);
valueFacade.setFetchModeJoin();
assertEquals(FetchMode.JOIN, manyToOneTarget.getFetchMode());
}
Aggregations