Examples of readFromJDBC()


Examples of org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC()

    defaultStrategy.setSettings(qqsettings);
    strategy.setSettings(qqsettings);
   
        jmdc.setReverseEngineeringStrategy(strategy);
       
    jmdc.readFromJDBC();
  }

   
    public void setPackageName(String pkgName) {
        packageName = pkgName;
View Full Code Here

Examples of org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC()

    JDBCMetaDataConfiguration configuration = new JDBCMetaDataConfiguration();
   
    OverrideRepository or = new OverrideRepository();
    or.addSchemaSelection(new SchemaSelection(null, SCHEMA));
    configuration.setReverseEngineeringStrategy(or.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy()));
    configuration.readFromJDBC();
   
    List tables = getTables(configuration);
   
    assertEquals(2,tables.size());
   
View Full Code Here

Examples of org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC()

    JDBCMetaDataConfiguration configuration = new JDBCMetaDataConfiguration();
   
    OverrideRepository or = new OverrideRepository();
    or.addSchemaSelection(new SchemaSelection(null, "OVRTEST"));
    configuration.setReverseEngineeringStrategy(or.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy()));
    configuration.readFromJDBC();
   
    List tables = getTables(configuration);
   
    assertEquals(2,tables.size());
   
View Full Code Here

Examples of org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC()

   
    OverrideRepository or = new OverrideRepository();
    or.addSchemaSelection(new SchemaSelection(null, "OVRTEST"));
    or.addSchemaSelection(new SchemaSelection(null, null));
    configuration.setReverseEngineeringStrategy(or.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy()));
    configuration.readFromJDBC();
   
    Set tables = new HashSet();
    Iterator iter = configuration.getTableMappings();
    while(iter.hasNext()) {
      Table element = (Table) iter.next();
View Full Code Here

Examples of org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC()

  public void testUseDefault() {
   
    JDBCMetaDataConfiguration configuration = new JDBCMetaDataConfiguration();
    configuration.setProperty(Environment.DEFAULT_SCHEMA, "OVRTEST");
    configuration.setProperty(Environment.DEFAULT_SCHEMA, "OVRTEST");
    configuration.readFromJDBC();
   
    List tables = getTables(configuration);
   
    assertEquals(2,tables.size());
   
View Full Code Here

Examples of org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC()

    or.addResource(FOREIGN_KEY_TEST_XML);
    ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy());
 
    JDBCMetaDataConfiguration localCfg = new JDBCMetaDataConfiguration();
    localCfg.setReverseEngineeringStrategy(repository);
    localCfg.readFromJDBC();     
   
    PersistentClass project = localCfg.getClassMapping("Project");
   
    assertNotNull(project.getProperty("worksOns"));
    assertPropertyNotExists(project, "employee", "should be removed by reveng.xml");
View Full Code Here

Examples of org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC()

    or.addResource(FOREIGN_KEY_TEST_XML);
    ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy());

    JDBCMetaDataConfiguration localCfg = new JDBCMetaDataConfiguration();
    localCfg.setReverseEngineeringStrategy(repository);
    localCfg.readFromJDBC();     

    PersistentClass person = localCfg.getClassMapping("Person");
    PersistentClass addressPerson = localCfg.getClassMapping("AddressPerson");
    PersistentClass addressMultiPerson = localCfg.getClassMapping("AddressMultiPerson");
    PersistentClass multiPerson = localCfg.getClassMapping("MultiPerson");
View Full Code Here

Examples of org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC()

    JDBCMetaDataConfiguration localCfg = new JDBCMetaDataConfiguration();
    localCfg.setReverseEngineeringStrategy(repository);
   
    try {
      localCfg.readFromJDBC();
      fail("Should fail because foreign key is already defined in the database"); // maybe we should ignore the definition and only listen to what is overwritten ? For now we error.
    } catch(MappingException me) {
      assertTrue(me.getMessage().indexOf("already defined")>=0);     
    }
   
View Full Code Here

Examples of org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC()

    or.addResource(FOREIGN_KEY_TEST_XML);
    ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy());
 
    JDBCMetaDataConfiguration localCfg = new JDBCMetaDataConfiguration();
    localCfg.setReverseEngineeringStrategy(repository);
    localCfg.readFromJDBC();     
     
    PersistentClass classMapping = localCfg.getClassMapping("Employee");
    Property property = classMapping.getProperty("manager")

    assertEquals("all", property.getCascade());
View Full Code Here

Examples of org.hibernate.cfg.JDBCMetaDataConfiguration.readFromJDBC()

    JDBCMetaDataConfiguration configuration = new JDBCMetaDataConfiguration();
   
    OverrideRepository ox = new OverrideRepository();
    ox.addSchemaSelection(new SchemaSelection(null, null, "DUMMY.*"));
    configuration.setReverseEngineeringStrategy(ox.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy()));
    configuration.readFromJDBC();
   
    Iterator tableMappings = configuration.getTableMappings();
    Table t = (Table) tableMappings.next();
    assertEquals(t.getName(), "DUMMY");
    assertFalse(tableMappings.hasNext());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.