Search in sources :

Example 56 with Collection

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

the class ValueFacadeTest method testGetCollectionTable.

@Test
public void testGetCollectionTable() {
    Table tableTarget = new Table();
    Collection valueTarget = new Set(DummyMetadataBuildingContext.INSTANCE, null);
    valueFacade = FACADE_FACTORY.createValue(valueTarget);
    assertNull(valueFacade.getCollectionTable());
    valueTarget.setCollectionTable(tableTarget);
    assertSame(tableTarget, ((IFacade) valueFacade.getCollectionTable()).getTarget());
}
Also used : ITable(org.jboss.tools.hibernate.runtime.spi.ITable) Table(org.hibernate.mapping.Table) Set(org.hibernate.mapping.Set) Collection(org.hibernate.mapping.Collection) Test(org.junit.jupiter.api.Test)

Example 57 with Collection

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

the class ValueFacadeTest method testSetCollectionTable.

@Test
public void testSetCollectionTable() {
    Table tableTarget = new Table();
    ITable tableFacade = FACADE_FACTORY.createTable(tableTarget);
    Collection valueTarget = new Set(DummyMetadataBuildingContext.INSTANCE, null);
    valueFacade = FACADE_FACTORY.createValue(valueTarget);
    assertNull(valueTarget.getCollectionTable());
    valueFacade.setCollectionTable(tableFacade);
    assertSame(tableTarget, valueTarget.getCollectionTable());
}
Also used : ITable(org.jboss.tools.hibernate.runtime.spi.ITable) Table(org.hibernate.mapping.Table) Set(org.hibernate.mapping.Set) Collection(org.hibernate.mapping.Collection) ITable(org.jboss.tools.hibernate.runtime.spi.ITable) Test(org.junit.jupiter.api.Test)

Example 58 with Collection

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

the class ValueFacadeTest method testSetLazy.

@Test
public void testSetLazy() {
    Collection collectionTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
    valueFacade = FACADE_FACTORY.createValue(collectionTarget);
    valueFacade.setLazy(true);
    assertTrue(collectionTarget.isLazy());
    valueFacade.setLazy(false);
    assertFalse(collectionTarget.isLazy());
}
Also used : Collection(org.hibernate.mapping.Collection) Bag(org.hibernate.mapping.Bag) IdentifierBag(org.hibernate.mapping.IdentifierBag) Test(org.junit.jupiter.api.Test)

Example 59 with Collection

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

the class ValueFacadeTest method testGetCollectionTable.

@Test
public void testGetCollectionTable() {
    Table tableTarget = new Table();
    Collection valueTarget = new Set(DummyMetadataBuildingContext.INSTANCE, null);
    valueFacade = FACADE_FACTORY.createValue(valueTarget);
    assertNull(valueFacade.getCollectionTable());
    valueTarget.setCollectionTable(tableTarget);
    assertSame(tableTarget, ((IFacade) valueFacade.getCollectionTable()).getTarget());
}
Also used : ITable(org.jboss.tools.hibernate.runtime.spi.ITable) Table(org.hibernate.mapping.Table) Set(org.hibernate.mapping.Set) Collection(org.hibernate.mapping.Collection) Test(org.junit.jupiter.api.Test)

Example 60 with Collection

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

the class ValueFacadeTest method testSetKey.

@Test
public void testSetKey() {
    KeyValue keyValueTarget = new SimpleValue(DummyMetadataBuildingContext.INSTANCE, null);
    IValue keyValueFacade = FACADE_FACTORY.createValue(keyValueTarget);
    Collection collectionTarget = new Bag(DummyMetadataBuildingContext.INSTANCE, null);
    IValue collectionFacade = FACADE_FACTORY.createValue(collectionTarget);
    assertNull(collectionTarget.getKey());
    collectionFacade.setKey(keyValueFacade);
    assertSame(keyValueTarget, collectionTarget.getKey());
}
Also used : KeyValue(org.hibernate.mapping.KeyValue) IValue(org.jboss.tools.hibernate.runtime.spi.IValue) Collection(org.hibernate.mapping.Collection) Bag(org.hibernate.mapping.Bag) IdentifierBag(org.hibernate.mapping.IdentifierBag) SimpleValue(org.hibernate.mapping.SimpleValue) Test(org.junit.jupiter.api.Test)

Aggregations

Collection (org.hibernate.mapping.Collection)134 Test (org.junit.jupiter.api.Test)80 Bag (org.hibernate.mapping.Bag)61 IdentifierBag (org.hibernate.mapping.IdentifierBag)61 SimpleValue (org.hibernate.mapping.SimpleValue)28 Table (org.hibernate.mapping.Table)27 Set (org.hibernate.mapping.Set)25 ITable (org.jboss.tools.hibernate.runtime.spi.ITable)24 Test (org.junit.Test)23 PersistentClass (org.hibernate.mapping.PersistentClass)22 ManyToOne (org.hibernate.mapping.ManyToOne)14 KeyValue (org.hibernate.mapping.KeyValue)13 IValue (org.jboss.tools.hibernate.runtime.spi.IValue)12 Property (org.hibernate.mapping.Property)11 Metadata (org.hibernate.boot.Metadata)9 MetadataSources (org.hibernate.boot.MetadataSources)9 Column (org.hibernate.mapping.Column)9 Iterator (java.util.Iterator)7 Component (org.hibernate.mapping.Component)7 AbstractValueFacade (org.jboss.tools.hibernate.runtime.common.AbstractValueFacade)7