Search in sources :

Example 6 with IFacade

use of org.jboss.tools.hibernate.runtime.common.IFacade in project jbosstools-hibernate by jbosstools.

the class ServiceImpl method newDatabaseCollector.

@Override
public IDatabaseCollector newDatabaseCollector(IJDBCReader jdbcReader) {
    assert jdbcReader instanceof IFacade;
    JDBCReader jdbcReaderTarget = (JDBCReader) ((IFacade) jdbcReader).getTarget();
    MetaDataDialect metadataDialect = jdbcReaderTarget.getMetaDataDialect();
    return facadeFactory.createDatabaseCollector(new DefaultDatabaseCollector(metadataDialect));
}
Also used : MetaDataDialect(org.hibernate.cfg.reveng.dialect.MetaDataDialect) DefaultDatabaseCollector(org.hibernate.cfg.reveng.DefaultDatabaseCollector) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) JDBCReader(org.hibernate.cfg.reveng.JDBCReader)

Example 7 with IFacade

use of org.jboss.tools.hibernate.runtime.common.IFacade 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 8 with IFacade

use of org.jboss.tools.hibernate.runtime.common.IFacade in project jbosstools-hibernate by jbosstools.

the class ServiceImpl method newReverseEngineeringStrategy.

@Override
public IReverseEngineeringStrategy newReverseEngineeringStrategy(String strategyName, IReverseEngineeringStrategy delegate) {
    assert delegate instanceof IFacade;
    ReverseEngineeringStrategy delegateTarget = (ReverseEngineeringStrategy) ((IFacade) delegate).getTarget();
    Object target = newReverseEngineeringStrategy(strategyName, delegateTarget);
    return facadeFactory.createReverseEngineeringStrategy(target);
}
Also used : IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) ReverseEngineeringStrategy(org.hibernate.cfg.reveng.ReverseEngineeringStrategy) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade)

Example 9 with IFacade

use of org.jboss.tools.hibernate.runtime.common.IFacade in project jbosstools-hibernate by jbosstools.

the class ServiceImpl method newSchemaExport.

@Override
public ISchemaExport newSchemaExport(IConfiguration hcfg) {
    ISchemaExport result = null;
    if (hcfg instanceof IFacade) {
        SchemaExport schemaExport = new SchemaExport((Configuration) ((IFacade) hcfg).getTarget());
        result = facadeFactory.createSchemaExport(schemaExport);
    }
    return result;
}
Also used : ISchemaExport(org.jboss.tools.hibernate.runtime.spi.ISchemaExport) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) ISchemaExport(org.jboss.tools.hibernate.runtime.spi.ISchemaExport) SchemaExport(org.hibernate.tool.hbm2ddl.SchemaExport)

Example 10 with IFacade

use of org.jboss.tools.hibernate.runtime.common.IFacade in project jbosstools-hibernate by jbosstools.

the class ServiceImpl method newHQLQueryPlan.

@Override
public IHQLQueryPlan newHQLQueryPlan(String query, boolean shallow, ISessionFactory sessionFactory) {
    assert sessionFactory instanceof IFacade;
    SessionFactoryImpl factory = (SessionFactoryImpl) ((IFacade) sessionFactory).getTarget();
    Map<String, Filter> enabledFilters = Collections.emptyMap();
    HQLQueryPlan queryPlan = new HQLQueryPlan(query, shallow, enabledFilters, factory);
    return facadeFactory.createHQLQueryPlan(queryPlan);
}
Also used : HQLQueryPlan(org.hibernate.engine.query.HQLQueryPlan) IHQLQueryPlan(org.jboss.tools.hibernate.runtime.spi.IHQLQueryPlan) Filter(org.hibernate.Filter) ITableFilter(org.jboss.tools.hibernate.runtime.spi.ITableFilter) TableFilter(org.hibernate.cfg.reveng.TableFilter) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) SessionFactoryImpl(org.hibernate.impl.SessionFactoryImpl)

Aggregations

IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)188 Test (org.junit.Test)156 IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)60 IValue (org.jboss.tools.hibernate.runtime.spi.IValue)40 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)29 Configuration (org.hibernate.cfg.Configuration)20 IReverseEngineeringStrategy (org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy)20 RootClass (org.hibernate.mapping.RootClass)19 Table (org.hibernate.mapping.Table)15 JDBCMetaDataConfiguration (org.hibernate.cfg.JDBCMetaDataConfiguration)13 File (java.io.File)12 PersistentClass (org.hibernate.mapping.PersistentClass)12 IProperty (org.jboss.tools.hibernate.runtime.spi.IProperty)12 ISessionFactory (org.jboss.tools.hibernate.runtime.spi.ISessionFactory)12 ITable (org.jboss.tools.hibernate.runtime.spi.ITable)11 Field (java.lang.reflect.Field)9 JDBCReader (org.hibernate.cfg.reveng.JDBCReader)9 IJDBCReader (org.jboss.tools.hibernate.runtime.spi.IJDBCReader)9 HashMap (java.util.HashMap)8 Map (java.util.Map)8