Package org.hibernate.cfg.reveng

Examples of org.hibernate.cfg.reveng.OverrideRepository$TableColumnKey


    DefaultReverseEngineeringStrategy defaultStrategy = new DefaultReverseEngineeringStrategy();
   
    ReverseEngineeringStrategy strategy = defaultStrategy;
   
    if(revengFiles!=null) {
      OverrideRepository or = new OverrideRepository();
     
      String[] fileNames = revengFiles.list();
      for (int i = 0; i < fileNames.length; i++) {
        or.addFile(new File(fileNames[i]) );
      }
      strategy = or.getReverseEngineeringStrategy(defaultStrategy);     
    }
   
    if(reverseEngineeringStrategyClass!=null) {
      strategy = loadreverseEngineeringStrategy(reverseEngineeringStrategyClass, strategy);     
    }
View Full Code Here


 
  public void testReadOnlySpecificSchema() {
   
    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

 
  public void testReadOnlySpecificSchema() {
   
    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

  public void testOverlapping() {
   
    JDBCMetaDataConfiguration configuration = new JDBCMetaDataConfiguration();
   
    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()) {
View Full Code Here

   
  }

  public void testSetAndManyToOne() {
   
    OverrideRepository or = buildOverrideRepository();
   
    or.addResource(FOREIGN_KEY_TEST_XML);
    ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy());
 
    JDBCMetaDataConfiguration localCfg = new JDBCMetaDataConfiguration();
    localCfg.setReverseEngineeringStrategy(repository);
    localCfg.readFromJDBC();     
   
View Full Code Here

   
  }
 
  public void testOneToOne() throws MalformedURLException, ClassNotFoundException {
   
    OverrideRepository or = buildOverrideRepository();
   
    or.addResource(FOREIGN_KEY_TEST_XML);
    ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy());

    JDBCMetaDataConfiguration localCfg = new JDBCMetaDataConfiguration();
    localCfg.setReverseEngineeringStrategy(repository);
    localCfg.readFromJDBC();     
View Full Code Here

  }
 
  public void testDuplicateForeignKeyDefinition() {
   
    OverrideRepository or = buildOverrideRepository();
   
    or.addResource(BAD_FOREIGNKEY_XML);
    ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy());

    JDBCMetaDataConfiguration localCfg = new JDBCMetaDataConfiguration();
    localCfg.setReverseEngineeringStrategy(repository);
   
    try {
View Full Code Here

   
  }
 
  public void testManyToOneAttributeOverrides() {

    OverrideRepository or = buildOverrideRepository();
   
    or.addResource(FOREIGN_KEY_TEST_XML);
    ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy());
 
    JDBCMetaDataConfiguration localCfg = new JDBCMetaDataConfiguration();
    localCfg.setReverseEngineeringStrategy(repository);
    localCfg.readFromJDBC();     
     
View Full Code Here

      settings = new SettingsFactory() {
        // trick to get hibernate.properties settings for defaultschema/catalog in here
      }.buildSettings(Environment.getProperties(), serviceRegistry);
    }
    //return new OverrideRepository(settings.getDefaultCatalogName(),settings.getDefaultSchemaName());
    return new OverrideRepository();
  }
View Full Code Here

  private static final String TEST_REVENG_XML = "org/hibernate/tool/test/jdbc2cfg/test.reveng.xml";
  private static final String DOC_REVENG_XML = "org/hibernate/tool/test/jdbc2cfg/docexample.reveng.xml";
  private static final String SCHEMA_REVENG_XML = "org/hibernate/tool/test/jdbc2cfg/schemaselection.reveng.xml";

  public void testReadTypeMappings() {
    OverrideRepository or = buildOverrideRepository();
       
    or.addResource(TEST_REVENG_XML);
    ReverseEngineeringStrategy repository = or.getReverseEngineeringStrategy(null);

    assertEquals("int", repository.columnToHibernateTypeName(null, null, Types.INTEGER, 5, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) );
    assertEquals("long", repository.columnToHibernateTypeName(null, null, Types.INTEGER, SQLTypeMapping.UNKNOWN_LENGTH, SQLTypeMapping.UNKNOWN_PRECISION, SQLTypeMapping.UNKNOWN_SCALE, false, false) );
    assertEquals("byte[]", repository.columnToHibernateTypeName(null, null, Types.BIGINT, SQLTypeMapping.UNKNOWN_LENGTH, 5, SQLTypeMapping.UNKNOWN_SCALE, false, false) );
    assertEquals("java.math.BigInteger", repository.columnToHibernateTypeName(null, null, Types.BIGINT, SQLTypeMapping.UNKNOWN_LENGTH, 2, 3, false, false) );
View Full Code Here

TOP

Related Classes of org.hibernate.cfg.reveng.OverrideRepository$TableColumnKey

Copyright © 2018 www.massapicom. 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.