Search in sources :

Example 41 with IPersistentClass

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

the class ServiceImplTest method testNewOneToOne.

@Test
public void testNewOneToOne() {
    IPersistentClass persistentClass = service.newRootClass();
    IValue oneToOne = service.newOneToOne(persistentClass);
    Assert.assertNotNull(oneToOne);
    Object target = ((IFacade) oneToOne).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof OneToOne);
}
Also used : OneToOne(org.hibernate.mapping.OneToOne) IValue(org.jboss.tools.hibernate.runtime.spi.IValue) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) Test(org.junit.Test)

Example 42 with IPersistentClass

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

the class ServiceImplTest method testNewOneToMany.

@Test
public void testNewOneToMany() {
    IPersistentClass persistentClass = service.newRootClass();
    IValue oneToMany = service.newOneToMany(persistentClass);
    Assert.assertNotNull(oneToMany);
    Object target = ((IFacade) oneToMany).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof OneToMany);
}
Also used : IValue(org.jboss.tools.hibernate.runtime.spi.IValue) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) OneToMany(org.hibernate.mapping.OneToMany) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) Test(org.junit.Test)

Example 43 with IPersistentClass

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

the class ServiceImplTest method testNewPrimitiveArray.

@Test
public void testNewPrimitiveArray() {
    IPersistentClass persistentClass = service.newRootClass();
    IValue primitiveArray = service.newPrimitiveArray(persistentClass);
    Assert.assertNotNull(primitiveArray);
    Object target = ((IFacade) primitiveArray).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof PrimitiveArray);
}
Also used : IValue(org.jboss.tools.hibernate.runtime.spi.IValue) PrimitiveArray(org.hibernate.mapping.PrimitiveArray) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) Test(org.junit.Test)

Example 44 with IPersistentClass

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

the class ServiceImplTest method testNewRootClass.

@Test
public void testNewRootClass() {
    IPersistentClass rootClass = service.newRootClass();
    Assert.assertNotNull(rootClass);
    Object target = ((IFacade) rootClass).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof RootClass);
}
Also used : RootClass(org.hibernate.mapping.RootClass) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) Test(org.junit.Test)

Example 45 with IPersistentClass

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

the class ServiceImplTest method testNewSingleTableSubclass.

@Test
public void testNewSingleTableSubclass() {
    IPersistentClass persistentClass = service.newRootClass();
    IPersistentClass singleTableSublass = service.newSingleTableSubclass(persistentClass);
    Assert.assertNotNull(singleTableSublass);
    Object target = ((IFacade) singleTableSublass).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof SingleTableSubclass);
    Assert.assertSame(persistentClass, singleTableSublass.getSuperclass());
    Assert.assertSame(((IFacade) persistentClass).getTarget(), ((SingleTableSubclass) target).getSuperclass());
}
Also used : IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) SingleTableSubclass(org.hibernate.mapping.SingleTableSubclass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) Test(org.junit.Test)

Aggregations

IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)175 Test (org.junit.Test)97 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)60 IValue (org.jboss.tools.hibernate.runtime.spi.IValue)51 RootClass (org.hibernate.mapping.RootClass)47 IProperty (org.jboss.tools.hibernate.runtime.spi.IProperty)46 PersistentClass (org.hibernate.mapping.PersistentClass)43 ConsoleConfiguration (org.hibernate.console.ConsoleConfiguration)19 AbstractPersistentClassFacade (org.jboss.tools.hibernate.runtime.common.AbstractPersistentClassFacade)16 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)16 ITable (org.jboss.tools.hibernate.runtime.spi.ITable)14 OneToMany (org.hibernate.mapping.OneToMany)12 HashMap (java.util.HashMap)8 Iterator (java.util.Iterator)8 JoinedSubclass (org.hibernate.mapping.JoinedSubclass)8 PrimitiveArray (org.hibernate.mapping.PrimitiveArray)8 Property (org.hibernate.mapping.Property)8 SingleTableSubclass (org.hibernate.mapping.SingleTableSubclass)8 IEditorPart (org.eclipse.ui.IEditorPart)7 PartInitException (org.eclipse.ui.PartInitException)7