Search in sources :

Example 21 with AbstractValueFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testSetElement.

@Test
public void testSetElement() {
    SimpleValue elementTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
    IValue elementFacade = new AbstractValueFacade(FACADE_FACTORY, elementTarget) {
    };
    Set valueTarget = new Set(DummyMetadataBuildingContext.INSTANCE, null);
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
    };
    assertNull(valueTarget.getElement());
    valueFacade.setElement(elementFacade);
    assertSame(elementTarget, valueTarget.getElement());
}
Also used : IValue(org.jboss.tools.hibernate.runtime.spi.IValue) AbstractValueFacade(org.jboss.tools.hibernate.runtime.common.AbstractValueFacade) Set(org.hibernate.mapping.Set) SimpleValue(org.hibernate.mapping.SimpleValue) BasicValue(org.hibernate.mapping.BasicValue) Test(org.junit.jupiter.api.Test)

Example 22 with AbstractValueFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testIsList.

@Test
public void testIsList() {
    valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
    };
    assertFalse(valueFacade.isList());
    valueTarget = new List(DummyMetadataBuildingContext.INSTANCE, null);
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
    };
    assertTrue(valueFacade.isList());
}
Also used : AbstractValueFacade(org.jboss.tools.hibernate.runtime.common.AbstractValueFacade) List(org.hibernate.mapping.List) BasicValue(org.hibernate.mapping.BasicValue) Test(org.junit.jupiter.api.Test)

Example 23 with AbstractValueFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testIsBag.

@Test
public void testIsBag() {
    SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, simpleValueTarget) {
    };
    assertFalse(valueFacade.isBag());
    Bag bagTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, bagTarget) {
    };
    assertTrue(valueFacade.isBag());
}
Also used : AbstractValueFacade(org.jboss.tools.hibernate.runtime.common.AbstractValueFacade) Bag(org.hibernate.mapping.Bag) IdentifierBag(org.hibernate.mapping.IdentifierBag) SimpleValue(org.hibernate.mapping.SimpleValue) BasicValue(org.hibernate.mapping.BasicValue) Test(org.junit.jupiter.api.Test)

Example 24 with AbstractValueFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testSetTypeName.

@Test
public void testSetTypeName() {
    SimpleValue valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
    };
    assertNull(valueTarget.getTypeName());
    valueFacade.setTypeName("java.lang.Integer");
    assertEquals("java.lang.Integer", valueTarget.getTypeName());
}
Also used : AbstractValueFacade(org.jboss.tools.hibernate.runtime.common.AbstractValueFacade) SimpleValue(org.hibernate.mapping.SimpleValue) BasicValue(org.hibernate.mapping.BasicValue) Test(org.junit.jupiter.api.Test)

Example 25 with AbstractValueFacade

use of org.jboss.tools.hibernate.runtime.common.AbstractValueFacade in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testIsInverse.

@Test
public void testIsInverse() {
    Collection collectionTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, collectionTarget) {
    };
    assertFalse(valueFacade.isInverse());
    collectionTarget.setInverse(true);
    assertTrue(valueFacade.isInverse());
}
Also used : AbstractValueFacade(org.jboss.tools.hibernate.runtime.common.AbstractValueFacade) Collection(org.hibernate.mapping.Collection) Bag(org.hibernate.mapping.Bag) IdentifierBag(org.hibernate.mapping.IdentifierBag) Test(org.junit.jupiter.api.Test)

Aggregations

AbstractValueFacade (org.jboss.tools.hibernate.runtime.common.AbstractValueFacade)51 Test (org.junit.jupiter.api.Test)51 BasicValue (org.hibernate.mapping.BasicValue)36 SimpleValue (org.hibernate.mapping.SimpleValue)22 RootClass (org.hibernate.mapping.RootClass)11 IdentifierBag (org.hibernate.mapping.IdentifierBag)8 Bag (org.hibernate.mapping.Bag)7 Collection (org.hibernate.mapping.Collection)7 Set (org.hibernate.mapping.Set)7 Component (org.hibernate.mapping.Component)6 Table (org.hibernate.mapping.Table)6 ITable (org.jboss.tools.hibernate.runtime.spi.ITable)6 IValue (org.jboss.tools.hibernate.runtime.spi.IValue)6 ManyToOne (org.hibernate.mapping.ManyToOne)5 PrimitiveArray (org.hibernate.mapping.PrimitiveArray)4 Array (org.hibernate.mapping.Array)3 List (org.hibernate.mapping.List)3 OneToMany (org.hibernate.mapping.OneToMany)3 OneToOne (org.hibernate.mapping.OneToOne)3 Column (org.hibernate.mapping.Column)2