Search in sources :

Example 6 with IPrimaryKey

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

the class TableFacadeTest method testGetPrimaryKey.

@Test
public void testGetPrimaryKey() {
    PrimaryKey primaryKey = new PrimaryKey();
    Table table = new Table();
    ITable tableFacade = FACADE_FACTORY.createTable(table);
    Assert.assertNull(tableFacade.getPrimaryKey());
    table.setPrimaryKey(primaryKey);
    IPrimaryKey primaryKeyFacade = tableFacade.getPrimaryKey();
    Assert.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.Test)

Example 7 with IPrimaryKey

use of org.jboss.tools.hibernate.runtime.spi.IPrimaryKey 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);
    Assert.assertNull(tableFacade.getPrimaryKey());
    table.setPrimaryKey(primaryKey);
    IPrimaryKey primaryKeyFacade = tableFacade.getPrimaryKey();
    Assert.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.Test)

Example 8 with IPrimaryKey

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

the class FacadeFactoryTest method testCreatePrimaryKey.

@Test
public void testCreatePrimaryKey() {
    PrimaryKey primaryKey = new PrimaryKey(null);
    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)

Example 9 with IPrimaryKey

use of org.jboss.tools.hibernate.runtime.spi.IPrimaryKey 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);
    Assert.assertNull(tableFacade.getPrimaryKey());
    table.setPrimaryKey(primaryKey);
    IPrimaryKey primaryKeyFacade = tableFacade.getPrimaryKey();
    Assert.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.Test)

Example 10 with IPrimaryKey

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

the class FacadeFactoryTest method testCreatePrimaryKey.

@Test
public void testCreatePrimaryKey() {
    PrimaryKey primaryKey = new PrimaryKey(null);
    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

IPrimaryKey (org.jboss.tools.hibernate.runtime.spi.IPrimaryKey)20 Test (org.junit.Test)17 PrimaryKey (org.hibernate.mapping.PrimaryKey)16 ITable (org.jboss.tools.hibernate.runtime.spi.ITable)11 Table (org.hibernate.mapping.Table)8 IColumn (org.jboss.tools.hibernate.runtime.spi.IColumn)4 ArrayList (java.util.ArrayList)2 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 List (java.util.List)1 TreeSet (java.util.TreeSet)1 ISelection (org.eclipse.jface.viewers.ISelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 IViewPart (org.eclipse.ui.IViewPart)1 IWorkbenchPage (org.eclipse.ui.IWorkbenchPage)1 ConsoleQueryParameter (org.hibernate.console.ConsoleQueryParameter)1 HibernateConsoleRuntimeException (org.hibernate.console.HibernateConsoleRuntimeException)1 QueryInputModel (org.hibernate.console.QueryInputModel)1 QueryPage (org.hibernate.console.QueryPage)1 IRevEngColumn (org.hibernate.eclipse.console.model.IRevEngColumn)1