Package org.hibernate.cfg

Examples of org.hibernate.cfg.ImprovedNamingStrategy


*/
public class CreateDataBaseTableByHibernateConfigFile {
 
 
  public static void main(String[] args) {
    Configuration configuration = new Configuration().configure().setNamingStrategy(new ImprovedNamingStrategy());
    SchemaExport export = new SchemaExport(configuration);
   
    export.setFormat(false);
    export.setOutputFile("src/test/resources/data/h2/create-table-new.sql");
    export.create(true, false);
View Full Code Here


public class CreateTestInitializeDataBaseSqlFile {
 
  public static void main(String[] args) {
   
    Configuration configuration = new Configuration().configure().setNamingStrategy(new ImprovedNamingStrategy());
    SchemaExport export = new SchemaExport(configuration);
   
    export.setFormat(false);
    export.setOutputFile("src/test/resources/h2schma.sql");
    export.create(true, false);
View Full Code Here

    private final String[] propertyNames = new String[] { "username", "email", "companyName", "eventLog" };
    private final String[] columnNames = new String[] { "username", "email", "company_name", "event_log" };

    @Test
    public void improvedNaming_ClassToTableName() {
        ImprovedNamingStrategy namingStrategy = new ImprovedNamingStrategy();

        for (int i = 0; i < classNames.length; i++) {
            String tableName = namingStrategy.classToTableName(classNames[i]);
            assertThat(tableName).isEqualTo(tableNames[i]);
        }
    }
View Full Code Here

        }
    }

    @Test
    public void improvedNaming_PropertyToColumnName() {
        ImprovedNamingStrategy namingStrategy = new ImprovedNamingStrategy();

        for (int i = 0; i < propertyNames.length; i++) {
            final String columnName = namingStrategy.propertyToColumnName(propertyNames[i]);
            assertThat(columnName).isEqualTo(columnNames[i]);
        }
    }
View Full Code Here

TOP

Related Classes of org.hibernate.cfg.ImprovedNamingStrategy

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.