Search in sources :

Example 16 with BasicValue

use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testIsComponent.

@Test
public void testIsComponent() {
    valueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, valueTarget) {
    };
    assertFalse(valueFacade.isComponent());
    Component component = new Component(DummyMetadataBuildingContext.INSTANCE, new RootClass(DummyMetadataBuildingContext.INSTANCE));
    valueFacade = new AbstractValueFacade(FACADE_FACTORY, component) {
    };
    assertTrue(valueFacade.isComponent());
}
Also used : RootClass(org.hibernate.mapping.RootClass) AbstractValueFacade(org.jboss.tools.hibernate.runtime.common.AbstractValueFacade) Component(org.hibernate.mapping.Component) BasicValue(org.hibernate.mapping.BasicValue) Test(org.junit.jupiter.api.Test)

Example 17 with BasicValue

use of org.hibernate.mapping.BasicValue in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testGetElement.

@Test
public void testGetElement() {
    Bag bagValueTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
    IValue bagValueFacade = new AbstractValueFacade(FACADE_FACTORY, bagValueTarget) {
    };
    assertNull(bagValueFacade.getElement());
    SimpleValue simpleValueTarget = new BasicValue(DummyMetadataBuildingContext.INSTANCE);
    bagValueTarget.setElement(simpleValueTarget);
    assertSame(simpleValueTarget, ((IFacade) bagValueFacade.getElement()).getTarget());
}
Also used : IValue(org.jboss.tools.hibernate.runtime.spi.IValue) 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 18 with BasicValue

use of org.hibernate.mapping.BasicValue 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 19 with BasicValue

use of org.hibernate.mapping.BasicValue 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 20 with BasicValue

use of org.hibernate.mapping.BasicValue 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)

Aggregations

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