use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsManyToOne.
@Test
public void testIsManyToOne() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isManyToOne());
ManyToOne manyToOne = new ManyToOne(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, manyToOne) {
};
assertTrue(valueFacade.isManyToOne());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetIndex.
@Test
public void testSetIndex() {
List valueTarget = new List(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertNull(valueTarget.getIndex());
SimpleValue indexTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
IValue indexFacade = new AbstractValueFacade(FACADE_FACTORY, indexTarget) {
};
valueFacade.setIndex(indexFacade);
assertSame(indexTarget, valueTarget.getIndex());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsSet.
@Test
public void testIsSet() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
assertFalse(valueFacade.isSet());
Set setTarget = new Set(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, setTarget) {
};
assertTrue(valueFacade.isSet());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testSetFetchModeJoin.
@Test
public void testSetFetchModeJoin() {
SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
assertNotEquals(FetchMode.JOIN, simpleValueTarget.getFetchMode());
valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
};
valueFacade.setFetchModeJoin();
assertNotEquals(FetchMode.JOIN, simpleValueTarget.getFetchMode());
Collection collectionTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
assertNotEquals(FetchMode.JOIN, collectionTarget.getFetchMode());
valueFacade = new AbstractValueFacade(FACADE_FACTORY, collectionTarget) {
};
valueFacade.setFetchModeJoin();
assertEquals(FetchMode.JOIN, collectionTarget.getFetchMode());
ManyToOne manyToOneTarget = new ManyToOne(DummyMetadataBuildingContext.INSTANCE, null);
assertNotEquals(FetchMode.JOIN, manyToOneTarget.getFetchMode());
valueFacade = new AbstractValueFacade(FACADE_FACTORY, manyToOneTarget) {
};
valueFacade.setFetchModeJoin();
assertEquals(FetchMode.JOIN, manyToOneTarget.getFetchMode());
}
use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.
the class ValueFacadeTest method testIsOneToMany.
@Test
public void testIsOneToMany() {
valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
};
assertFalse(valueFacade.isOneToMany());
OneToMany oneToMany = new OneToMany(DummyMetadataBuildingContext.INSTANCE, null);
valueFacade = new AbstractValueFacade(FACADE_FACTORY, oneToMany) {
};
assertTrue(valueFacade.isOneToMany());
}
Aggregations