Search in sources :

Example 11 with DefaultDatabaseCollector

use of org.hibernate.cfg.reveng.DefaultDatabaseCollector 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 12 with DefaultDatabaseCollector

use of org.hibernate.cfg.reveng.DefaultDatabaseCollector 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 13 with DefaultDatabaseCollector

use of org.hibernate.cfg.reveng.DefaultDatabaseCollector in project jbosstools-hibernate by jbosstools.

the class DatabaseCollectorFacadeTest method setUp.

@Before
public void setUp() throws Exception {
    databaseCollector = new DefaultDatabaseCollector(new JDBCMetaDataDialect()) {

        @Override
        public Iterator<Entry<String, List<Table>>> getQualifierEntries() {
            methodName = "getQualifierEntries";
            HashMap<String, List<Table>> map = new HashMap<String, List<Table>>();
            ArrayList<Table> list = new ArrayList<Table>();
            list.add(new Table("foo"));
            list.add(new Table("bar"));
            map.put("one", list);
            list = new ArrayList<Table>();
            list.add(new Table("fubar"));
            map.put("two", list);
            return map.entrySet().iterator();
        }
    };
    databaseCollectorFacade = new AbstractDatabaseCollectorFacade(FACADE_FACTORY, databaseCollector) {
    };
}
Also used : JDBCMetaDataDialect(org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect) Table(org.hibernate.mapping.Table) ITable(org.jboss.tools.hibernate.runtime.spi.ITable) AbstractDatabaseCollectorFacade(org.jboss.tools.hibernate.runtime.common.AbstractDatabaseCollectorFacade) HashMap(java.util.HashMap) DefaultDatabaseCollector(org.hibernate.cfg.reveng.DefaultDatabaseCollector) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) Before(org.junit.Before)

Example 14 with DefaultDatabaseCollector

use of org.hibernate.cfg.reveng.DefaultDatabaseCollector in project jbosstools-hibernate by jbosstools.

the class DatabaseCollectorFacadeTest method setUp.

@Before
public void setUp() throws Exception {
    databaseCollector = new DefaultDatabaseCollector(new JDBCMetaDataDialect()) {

        @Override
        public Iterator<Entry<String, List<Table>>> getQualifierEntries() {
            methodName = "getQualifierEntries";
            HashMap<String, List<Table>> map = new HashMap<String, List<Table>>();
            ArrayList<Table> list = new ArrayList<Table>();
            list.add(new Table("foo"));
            list.add(new Table("bar"));
            map.put("one", list);
            list = new ArrayList<Table>();
            list.add(new Table("fubar"));
            map.put("two", list);
            return map.entrySet().iterator();
        }
    };
    databaseCollectorFacade = new AbstractDatabaseCollectorFacade(FACADE_FACTORY, databaseCollector) {
    };
}
Also used : JDBCMetaDataDialect(org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect) Table(org.hibernate.mapping.Table) ITable(org.jboss.tools.hibernate.runtime.spi.ITable) AbstractDatabaseCollectorFacade(org.jboss.tools.hibernate.runtime.common.AbstractDatabaseCollectorFacade) HashMap(java.util.HashMap) DefaultDatabaseCollector(org.hibernate.cfg.reveng.DefaultDatabaseCollector) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) Before(org.junit.Before)

Example 15 with DefaultDatabaseCollector

use of org.hibernate.cfg.reveng.DefaultDatabaseCollector in project jbosstools-hibernate by jbosstools.

the class DatabaseCollectorFacadeTest method setUp.

@Before
public void setUp() throws Exception {
    databaseCollector = new DefaultDatabaseCollector(new JDBCMetaDataDialect()) {

        @Override
        public Iterator<Entry<String, List<Table>>> getQualifierEntries() {
            methodName = "getQualifierEntries";
            HashMap<String, List<Table>> map = new HashMap<String, List<Table>>();
            ArrayList<Table> list = new ArrayList<Table>();
            list.add(new Table("foo"));
            list.add(new Table("bar"));
            map.put("one", list);
            list = new ArrayList<Table>();
            list.add(new Table("fubar"));
            map.put("two", list);
            return map.entrySet().iterator();
        }
    };
    databaseCollectorFacade = new AbstractDatabaseCollectorFacade(FACADE_FACTORY, databaseCollector) {
    };
}
Also used : JDBCMetaDataDialect(org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect) Table(org.hibernate.mapping.Table) ITable(org.jboss.tools.hibernate.runtime.spi.ITable) AbstractDatabaseCollectorFacade(org.jboss.tools.hibernate.runtime.common.AbstractDatabaseCollectorFacade) HashMap(java.util.HashMap) DefaultDatabaseCollector(org.hibernate.cfg.reveng.DefaultDatabaseCollector) Iterator(java.util.Iterator) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) Before(org.junit.Before)

Aggregations

DefaultDatabaseCollector (org.hibernate.cfg.reveng.DefaultDatabaseCollector)16 ArrayList (java.util.ArrayList)8 HashMap (java.util.HashMap)8 Iterator (java.util.Iterator)8 List (java.util.List)8 JDBCReader (org.hibernate.cfg.reveng.JDBCReader)8 JDBCMetaDataDialect (org.hibernate.cfg.reveng.dialect.JDBCMetaDataDialect)8 MetaDataDialect (org.hibernate.cfg.reveng.dialect.MetaDataDialect)8 Table (org.hibernate.mapping.Table)8 AbstractDatabaseCollectorFacade (org.jboss.tools.hibernate.runtime.common.AbstractDatabaseCollectorFacade)8 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)8 IJDBCReader (org.jboss.tools.hibernate.runtime.spi.IJDBCReader)8 ITable (org.jboss.tools.hibernate.runtime.spi.ITable)8 Before (org.junit.Before)8