Search in sources :

Example 11 with SingleTableSubclass

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

the class PersistentClassFacadeTest method testIsAssignableToRootClass.

@Test
public void testIsAssignableToRootClass() {
    persistentClassTarget = new SingleTableSubclass(new RootClass(null), null);
    persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, persistentClassTarget);
    assertFalse(persistentClassFacade.isAssignableToRootClass());
    persistentClassTarget = new RootClass(null);
    persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, persistentClassTarget);
    assertTrue(persistentClassFacade.isAssignableToRootClass());
}
Also used : RootClass(org.hibernate.mapping.RootClass) SingleTableSubclass(org.hibernate.mapping.SingleTableSubclass) Test(org.junit.jupiter.api.Test)

Example 12 with SingleTableSubclass

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

the class ServiceImpl method newSingleTableSubclass.

@Override
public IPersistentClass newSingleTableSubclass(IPersistentClass persistentClass) {
    assert persistentClass instanceof IFacade;
    IPersistentClass result = facadeFactory.createPersistentClass(new SingleTableSubclass((PersistentClass) ((IFacade) persistentClass).getTarget(), null));
    ((AbstractPersistentClassFacade) result).setSuperClass(persistentClass);
    return result;
}
Also used : AbstractPersistentClassFacade(org.jboss.tools.hibernate.runtime.common.AbstractPersistentClassFacade) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) SingleTableSubclass(org.hibernate.mapping.SingleTableSubclass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) PersistentClass(org.hibernate.mapping.PersistentClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass)

Example 13 with SingleTableSubclass

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

the class ServiceImpl method newSingleTableSubclass.

@Override
public IPersistentClass newSingleTableSubclass(IPersistentClass persistentClass) {
    assert persistentClass instanceof IFacade;
    IPersistentClass result = facadeFactory.createPersistentClass(new SingleTableSubclass((PersistentClass) ((IFacade) persistentClass).getTarget(), null));
    ((AbstractPersistentClassFacade) result).setSuperClass(persistentClass);
    return result;
}
Also used : AbstractPersistentClassFacade(org.jboss.tools.hibernate.runtime.common.AbstractPersistentClassFacade) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) SingleTableSubclass(org.hibernate.mapping.SingleTableSubclass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) PersistentClass(org.hibernate.mapping.PersistentClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass)

Example 14 with SingleTableSubclass

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

the class ServiceImpl method newSingleTableSubclass.

@Override
public IPersistentClass newSingleTableSubclass(IPersistentClass persistentClass) {
    assert persistentClass instanceof IFacade;
    IPersistentClass result = facadeFactory.createPersistentClass(new SingleTableSubclass((PersistentClass) ((IFacade) persistentClass).getTarget(), null));
    ((AbstractPersistentClassFacade) result).setSuperClass(persistentClass);
    return result;
}
Also used : AbstractPersistentClassFacade(org.jboss.tools.hibernate.runtime.common.AbstractPersistentClassFacade) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) SingleTableSubclass(org.hibernate.mapping.SingleTableSubclass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) PersistentClass(org.hibernate.mapping.PersistentClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass)

Example 15 with SingleTableSubclass

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

the class PersistentClassFacadeTest method testIsRootClass.

@Test
public void testIsRootClass() {
    persistentClassTarget = new SingleTableSubclass(new RootClass(null), null);
    persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, persistentClassTarget);
    assertFalse(persistentClassFacade.isRootClass());
    persistentClassTarget = new RootClass(null);
    persistentClassFacade = new PersistentClassFacadeImpl(FACADE_FACTORY, persistentClassTarget);
    assertTrue(persistentClassFacade.isRootClass());
}
Also used : RootClass(org.hibernate.mapping.RootClass) SingleTableSubclass(org.hibernate.mapping.SingleTableSubclass) Test(org.junit.jupiter.api.Test)

Aggregations

SingleTableSubclass (org.hibernate.mapping.SingleTableSubclass)46 Test (org.junit.jupiter.api.Test)33 RootClass (org.hibernate.mapping.RootClass)23 IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)22 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)21 PersistentClass (org.hibernate.mapping.PersistentClass)11 AbstractPersistentClassFacade (org.jboss.tools.hibernate.runtime.common.AbstractPersistentClassFacade)11 IdentifiableTypeSource (org.hibernate.boot.model.source.spi.IdentifiableTypeSource)1 JoinedSubclass (org.hibernate.mapping.JoinedSubclass)1 Subclass (org.hibernate.mapping.Subclass)1 UnionSubclass (org.hibernate.mapping.UnionSubclass)1 Test (org.junit.Test)1