Search in sources :

Example 56 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());
    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 57 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("jboss tools", 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 58 with PrimaryKey

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

the class PrimaryKeyFacadeTest method beforeEach.

@BeforeEach
public void beforeEach() {
    primaryKeyTarget = new PrimaryKey();
    primaryKeyTarget.setTable(new Table());
    primaryKeyFacade = new AbstractPrimaryKeyFacade(FACADE_FACTORY, primaryKeyTarget) {
    };
}
Also used : Table(org.hibernate.mapping.Table) ITable(org.jboss.tools.hibernate.runtime.spi.ITable) AbstractPrimaryKeyFacade(org.jboss.tools.hibernate.runtime.common.AbstractPrimaryKeyFacade) IPrimaryKey(org.jboss.tools.hibernate.runtime.spi.IPrimaryKey) PrimaryKey(org.hibernate.mapping.PrimaryKey) BeforeEach(org.junit.jupiter.api.BeforeEach)

Example 59 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();
    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 60 with PrimaryKey

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

the class PrimaryKeyFacadeTest method beforeEach.

@BeforeEach
public void beforeEach() {
    primaryKeyTarget = new PrimaryKey(new Table());
    primaryKeyFacade = new AbstractPrimaryKeyFacade(FACADE_FACTORY, primaryKeyTarget) {
    };
}
Also used : Table(org.hibernate.mapping.Table) ITable(org.jboss.tools.hibernate.runtime.spi.ITable) AbstractPrimaryKeyFacade(org.jboss.tools.hibernate.runtime.common.AbstractPrimaryKeyFacade) IPrimaryKey(org.jboss.tools.hibernate.runtime.spi.IPrimaryKey) PrimaryKey(org.hibernate.mapping.PrimaryKey) BeforeEach(org.junit.jupiter.api.BeforeEach)

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