Search in sources :

Example 81 with IPersistentClass

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

the class PersistentClassViewAdapter method createInheritanceAssociations.

private void createInheritanceAssociations() {
    IPersistentClass superclass = getPersistentClass().getSuperclass();
    if (superclass != null) {
        PersistentClassViewAdapter target = getConfiguration().getPersistentClassViewAdapter(superclass.getEntityName());
        InheritanceViewAdapter iva = new InheritanceViewAdapter(this, target);
        this.addSourceAssociation(iva);
        target.addTargetAssociation(iva);
    }
}
Also used : IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass)

Example 82 with IPersistentClass

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

the class AbstractConfigurationFacade method initializeClassMappings.

protected void initializeClassMappings() {
    HashMap<String, IPersistentClass> classMappings = new HashMap<String, IPersistentClass>();
    Iterator<?> origin = (Iterator<?>) Util.invokeMethod(getTarget(), "getClassMappings", new Class[] {}, new Object[] {});
    while (origin.hasNext()) {
        IPersistentClass pc = getFacadeFactory().createPersistentClass(origin.next());
        classMappings.put(pc.getEntityName(), pc);
    }
    setClassMappings(classMappings);
}
Also used : HashMap(java.util.HashMap) Iterator(java.util.Iterator) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass)

Example 83 with IPersistentClass

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

the class ServiceImpl method newJoinedSubclass.

@Override
public IPersistentClass newJoinedSubclass(IPersistentClass persistentClass) {
    assert persistentClass instanceof IFacade;
    IPersistentClass result = facadeFactory.createPersistentClass(new JoinedSubclass((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) JoinedSubclass(org.hibernate.mapping.JoinedSubclass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) PersistentClass(org.hibernate.mapping.PersistentClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass)

Example 84 with IPersistentClass

use of org.jboss.tools.hibernate.runtime.spi.IPersistentClass 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 85 with IPersistentClass

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

the class ConfigurationFacadeImpl method initializeClassMappings.

@Override
protected void initializeClassMappings() {
    HashMap<String, IPersistentClass> classMappings = new HashMap<String, IPersistentClass>();
    Iterator<PersistentClass> origin = getMetadata().getEntityBindings().iterator();
    while (origin.hasNext()) {
        IPersistentClass pc = getFacadeFactory().createPersistentClass(origin.next());
        classMappings.put(pc.getEntityName(), pc);
    }
    for (IPersistentClass pc : addedClasses) {
        classMappings.put(pc.getEntityName(), pc);
    }
    setClassMappings(classMappings);
}
Also used : HashMap(java.util.HashMap) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) PersistentClass(org.hibernate.mapping.PersistentClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass)

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