Search in sources :

Example 86 with IValue

use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testGetElement.

@Test
public void testGetElement() {
    Bag bagValueTarget = new Bag(null);
    IValue bagValueFacade = FACADE_FACTORY.createValue(bagValueTarget);
    Assert.assertNull(bagValueFacade.getElement());
    SimpleValue simpleValueTarget = new SimpleValue();
    bagValueTarget.setElement(simpleValueTarget);
    Assert.assertSame(simpleValueTarget, ((IFacade) bagValueFacade.getElement()).getTarget());
}
Also used : IValue(org.jboss.tools.hibernate.runtime.spi.IValue) Bag(org.hibernate.mapping.Bag) IdentifierBag(org.hibernate.mapping.IdentifierBag) SimpleValue(org.hibernate.mapping.SimpleValue) Test(org.junit.Test)

Example 87 with IValue

use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testSetElement.

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

Example 88 with IValue

use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.

the class TableFacadeTest method testGetIdentifierValue.

@Test
public void testGetIdentifierValue() {
    Table table = new Table();
    ITable tableFacade = FACADE_FACTORY.createTable(table);
    IValue valueFacade = tableFacade.getIdentifierValue();
    Assert.assertNull(valueFacade);
    KeyValue value = new SimpleValue();
    table.setIdentifierValue(value);
    valueFacade = tableFacade.getIdentifierValue();
    Assert.assertSame(value, ((IFacade) valueFacade).getTarget());
}
Also used : Table(org.hibernate.mapping.Table) ITable(org.jboss.tools.hibernate.runtime.spi.ITable) IValue(org.jboss.tools.hibernate.runtime.spi.IValue) KeyValue(org.hibernate.mapping.KeyValue) ITable(org.jboss.tools.hibernate.runtime.spi.ITable) SimpleValue(org.hibernate.mapping.SimpleValue) Test(org.junit.Test)

Example 89 with IValue

use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.

the class ValueFacadeTest method testSetElement.

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

Example 90 with IValue

use of org.jboss.tools.hibernate.runtime.spi.IValue in project jbosstools-hibernate by jbosstools.

the class ColumnFacadeTest method testGetValue.

public void testGetValue() throws Exception {
    Value targetValue = null;
    column.setValue(targetValue);
    Assert.assertNull(columnFacade.getValue());
    targetValue = new SimpleValue(new Configuration().createMappings());
    column.setValue(targetValue);
    IValue value = columnFacade.getValue();
    Assert.assertNotNull(value);
    Assert.assertSame(targetValue, ((IFacade) value).getTarget());
}
Also used : IValue(org.jboss.tools.hibernate.runtime.spi.IValue) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Configuration(org.hibernate.cfg.Configuration) SimpleValue(org.hibernate.mapping.SimpleValue) IValue(org.jboss.tools.hibernate.runtime.spi.IValue) Value(org.hibernate.mapping.Value) SimpleValue(org.hibernate.mapping.SimpleValue)

Aggregations

IValue (org.jboss.tools.hibernate.runtime.spi.IValue)144 Test (org.junit.Test)105 SimpleValue (org.hibernate.mapping.SimpleValue)68 IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)59 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)40 Bag (org.hibernate.mapping.Bag)20 Set (org.hibernate.mapping.Set)20 IProperty (org.jboss.tools.hibernate.runtime.spi.IProperty)20 ITable (org.jboss.tools.hibernate.runtime.spi.ITable)17 IdentifierBag (org.hibernate.mapping.IdentifierBag)16 KeyValue (org.hibernate.mapping.KeyValue)16 RootClass (org.hibernate.mapping.RootClass)16 Value (org.hibernate.mapping.Value)16 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)13 Collection (org.hibernate.mapping.Collection)8 Component (org.hibernate.mapping.Component)8 List (org.hibernate.mapping.List)8 PersistentClass (org.hibernate.mapping.PersistentClass)8 PrimitiveArray (org.hibernate.mapping.PrimitiveArray)8 Table (org.hibernate.mapping.Table)8