Package org.hibernate.cfg.reveng

Examples of org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy


  public void initialize(Configuration cfg, Settings settings) {
    super.initialize( cfg, settings );
    dialect = settings.getDialect();

    tableSelector = new TableSelectorStrategy(
        new DefaultReverseEngineeringStrategy() );
    reader = JDBCReaderFactory.newJDBCReader( cfg.getProperties(),
        settings, tableSelector );
    dbc = new DefaultDatabaseCollector(reader.getMetaDataDialect());
    mapping = cfg.buildMapping();
  }
View Full Code Here


    JDBCMetaDataConfiguration jmdc = (JDBCMetaDataConfiguration) configuration;
    super.doConfiguration(jmdc);
   
        jmdc.setPreferBasicCompositeIds(preferBasicCompositeIds);

    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);     
    }
   
    ReverseEngineeringSettings qqsettings =
      new ReverseEngineeringSettings(strategy).setDefaultPackageName(packageName)
      .setDetectManyToMany( detectManyToMany )
      .setDetectOneToOne( detectOneToOne )
      .setDetectOptimisticLock( detectOptimisticLock );
 
    defaultStrategy.setSettings(qqsettings);
    strategy.setSettings(qqsettings);
   
        jmdc.setReverseEngineeringStrategy(strategy);
       
    jmdc.readFromJDBC();
View Full Code Here

      return selectedTableNames;
   }

   private ReverseEngineeringStrategy createReverseEngineeringStrategy()
   {
      ReverseEngineeringStrategy strategy = new DefaultReverseEngineeringStrategy();
      ReverseEngineeringSettings revengsettings =
               new ReverseEngineeringSettings(strategy)
                        .setDefaultPackageName(descriptor.getTargetPackage())
                        .setDetectManyToMany(true)
                        .setDetectOneToOne(true)
                        .setDetectOptimisticLock(true);
      strategy.setSettings(revengsettings);
      return strategy;
   }
View Full Code Here

      return selectedTableNames;
   }

   private ReverseEngineeringStrategy createReverseEngineeringStrategy()
   {
      ReverseEngineeringStrategy strategy = new DefaultReverseEngineeringStrategy();
      ReverseEngineeringSettings revengsettings =
               new ReverseEngineeringSettings(strategy)
                        .setDefaultPackageName(descriptor.getTargetPackage())
                        .setDetectManyToMany(true)
                        .setDetectOneToOne(true)
                        .setDetectOptimisticLock(true);
      strategy.setSettings(revengsettings);
      return strategy;
   }
View Full Code Here

      return selectedTableNames;
   }

   private ReverseEngineeringStrategy createReverseEngineeringStrategy()
   {
      ReverseEngineeringStrategy strategy = new DefaultReverseEngineeringStrategy();
      ReverseEngineeringSettings revengsettings =
               new ReverseEngineeringSettings(strategy)
                        .setDefaultPackageName(descriptor.getTargetPackage())
                        .setDetectManyToMany(true)
                        .setDetectOneToOne(true)
                        .setDetectOptimisticLock(true);
      strategy.setSettings(revengsettings);
      return strategy;
   }
View Full Code Here

      return selectedTableNames;
   }

   private ReverseEngineeringStrategy createReverseEngineeringStrategy()
   {
      ReverseEngineeringStrategy strategy = new DefaultReverseEngineeringStrategy();
      ReverseEngineeringSettings revengsettings =
               new ReverseEngineeringSettings(strategy)
                        .setDefaultPackageName(descriptor.getTargetPackage())
                        .setDetectManyToMany(true)
                        .setDetectOneToOne(true)
                        .setDetectOptimisticLock(true);
      strategy.setSettings(revengsettings);
      return strategy;
   }
View Full Code Here

   
    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

    ServiceRegistry serviceRegistry = builder.build();
    Settings buildSettings = cfg.buildSettings(serviceRegistry);
       
    MetaDataDialect realMetaData = JDBCReaderFactory.newMetaDataDialect( serviceRegistry.getService(JdbcServices.class).getDialect(), cfg.getProperties() );
   
    JDBCReader reader = JDBCReaderFactory.newJDBCReader( buildSettings, new DefaultReverseEngineeringStrategy(), realMetaData, serviceRegistry );
   
    DatabaseCollector dc = new DefaultDatabaseCollector(reader.getMetaDataDialect());
    reader.readDatabaseSchema( dc, null, SCHEMA );
   
    assertNotNull("The table should be found", dc.getTable(SCHEMA, null, TABLE1));
View Full Code Here

    };
  }
 
  protected void configure(JDBCMetaDataConfiguration cfg2configure) {
   
    DefaultReverseEngineeringStrategy configurableNamingStrategy = new DefaultReverseEngineeringStrategy();
    configurableNamingStrategy.setSettings(new ReverseEngineeringSettings(configurableNamingStrategy).setDefaultPackageName("org.reveng").setCreateCollectionForForeignKey(false));
    cfg2configure.setReverseEngineeringStrategy(configurableNamingStrategy);
  }
View Full Code Here

  protected void setUp() throws Exception {
    super.setUp();
   
    localCfg = new JDBCMetaDataConfiguration();
       
        DefaultReverseEngineeringStrategy c = new DefaultReverseEngineeringStrategy();
        c.setSettings(new ReverseEngineeringSettings(c).setDetectManyToMany(false));       
        localCfg.setReverseEngineeringStrategy(c);
        localCfg.readFromJDBC();
  }
View Full Code Here

TOP

Related Classes of org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy

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.