Search in sources :

Example 16 with PrimaryKey

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

the class TableFacadeTest method testGetPrimaryKey.

@Test
public void testGetPrimaryKey() {
    Table table = new Table();
    PrimaryKey primaryKey = new PrimaryKey(table);
    ITable tableFacade = FACADE_FACTORY.createTable(table);
    assertNull(tableFacade.getPrimaryKey());
    table.setPrimaryKey(primaryKey);
    IPrimaryKey primaryKeyFacade = tableFacade.getPrimaryKey();
    assertSame(primaryKey, ((IFacade) primaryKeyFacade).getTarget());
}
Also used : Table(org.hibernate.mapping.Table) ITable(org.jboss.tools.hibernate.runtime.spi.ITable) IPrimaryKey(org.jboss.tools.hibernate.runtime.spi.IPrimaryKey) PrimaryKey(org.hibernate.mapping.PrimaryKey) ITable(org.jboss.tools.hibernate.runtime.spi.ITable) IPrimaryKey(org.jboss.tools.hibernate.runtime.spi.IPrimaryKey) Test(org.junit.jupiter.api.Test)

Example 17 with PrimaryKey

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

the class ServiceImpl method newTable.

@Override
public ITable newTable(String name) {
    Table target = new Table(name);
    target.setPrimaryKey(new PrimaryKey(target));
    return facadeFactory.createTable(target);
}
Also used : ITable(org.jboss.tools.hibernate.runtime.spi.ITable) Table(org.hibernate.mapping.Table) PrimaryKey(org.hibernate.mapping.PrimaryKey)

Example 18 with PrimaryKey

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

the class ServiceImpl method newTable.

@Override
public ITable newTable(String name) {
    Table target = new Table(name);
    target.setPrimaryKey(new PrimaryKey(target));
    return facadeFactory.createTable(target);
}
Also used : ITable(org.jboss.tools.hibernate.runtime.spi.ITable) Table(org.hibernate.mapping.Table) PrimaryKey(org.hibernate.mapping.PrimaryKey)

Example 19 with PrimaryKey

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

the class ServiceImpl method newTable.

@Override
public ITable newTable(String name) {
    Table target = new Table(name);
    target.setPrimaryKey(new PrimaryKey(target));
    return facadeFactory.createTable(target);
}
Also used : ITable(org.jboss.tools.hibernate.runtime.spi.ITable) Table(org.hibernate.mapping.Table) PrimaryKey(org.hibernate.mapping.PrimaryKey)

Example 20 with PrimaryKey

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

the class FacadeFactoryTest method testCreatePrimaryKey.

@Test
public void testCreatePrimaryKey() {
    PrimaryKey primaryKey = new PrimaryKey();
    IPrimaryKey facade = facadeFactory.createPrimaryKey(primaryKey);
    Assert.assertSame(primaryKey, ((IFacade) facade).getTarget());
}
Also used : PrimaryKey(org.hibernate.mapping.PrimaryKey) IPrimaryKey(org.jboss.tools.hibernate.runtime.spi.IPrimaryKey) IPrimaryKey(org.jboss.tools.hibernate.runtime.spi.IPrimaryKey) Test(org.junit.Test)

Aggregations

PrimaryKey (org.hibernate.mapping.PrimaryKey)62 Table (org.hibernate.mapping.Table)49 IPrimaryKey (org.jboss.tools.hibernate.runtime.spi.IPrimaryKey)46 ITable (org.jboss.tools.hibernate.runtime.spi.ITable)46 Test (org.junit.jupiter.api.Test)32 Column (org.hibernate.mapping.Column)15 SimpleValue (org.hibernate.mapping.SimpleValue)12 RootClass (org.hibernate.mapping.RootClass)11 AbstractPrimaryKeyFacade (org.jboss.tools.hibernate.runtime.common.AbstractPrimaryKeyFacade)11 IColumn (org.jboss.tools.hibernate.runtime.spi.IColumn)11 IHQLQueryPlan (org.jboss.tools.hibernate.runtime.spi.IHQLQueryPlan)11 BeforeEach (org.junit.jupiter.api.BeforeEach)11 Filter (org.hibernate.Filter)10 TableFilter (org.hibernate.cfg.reveng.TableFilter)10 ITableFilter (org.jboss.tools.hibernate.runtime.spi.ITableFilter)10 HQLQueryPlan (org.hibernate.engine.query.spi.HQLQueryPlan)9 StandardServiceRegistry (org.hibernate.boot.registry.StandardServiceRegistry)8 StandardServiceRegistryBuilder (org.hibernate.boot.registry.StandardServiceRegistryBuilder)8 InvocationHandler (java.lang.reflect.InvocationHandler)7 Method (java.lang.reflect.Method)7