@Test public void classToTableName() { String[] args = new String[] { "Class", "Classes", "Key", "Query", "Answer", "Prefix", "CamelCaseClassName", "User", "Face", "Cliff", "Safe", "Book", "Table", "Dish", "Match", "Diagnosis", "Axis" }; String[] exps = new String[] { "classes", "classes", "keys", "queries", "answers", "prefixes", "camel_case_class_names", "users", "faces", "cliffs", "safes", "books", "tables", "dishes", "matches", "diagnoses", "axes" }; for (int i = 0; i < args.length; i++) { String arg = args[i], exp = TABLE_PREFIX + exps[i]; assertThat(strategy.classToTableName(arg)).isEqualTo(exp); } strategy.getOptions().setTablePrefix(null); assertThat(strategy.classToTableName("CamelCaseClassName")) .isEqualTo("camel_case_class_names"); }
public String classToTableName(String className) { String result = join(options.getTablePrefix(), classToPluralizedName(className)); if (needRestrict(options.isRestrictTableNames())) { return assertName(new NameShorter(options.getMaxLength(), options.hasTablePrefix()) .tableName(result), className, "@Table(name=\"prefix_table_name\")"); } return result; }
HibernateNamingStrategy { public String classToTableName(String className) { String result = join(options.getTablePrefix(), classToPluralizedName(className)); if (needRestrict(options.isRestrictTableNames())) { return assertName(new NameShorter(options.getMaxLength(), options.hasTablePrefix()) .tableName(result), className, "@Table(name=\"prefix_table_name\")"); } return result; } }
HibernateNamingStrategy { public String classToTableName(String className) { String result = join(options.getTablePrefix(), classToPluralizedName(className)); if (needRestrict(options.isRestrictTableNames())) { return assertName(new NameShorter(options.getMaxLength(), options.hasTablePrefix()) .tableName(result), className, "@Table(name=\"prefix_table_name\")"); } return result; } HibernateNamingStrategy(StrategyOptions options); }
HibernateNamingStrategy { public String classToTableName(String className) { String result = join(options.getTablePrefix(), classToPluralizedName(className)); if (needRestrict(options.isRestrictTableNames())) { return assertName(new NameShorter(options.getMaxLength(), options.hasTablePrefix()) .tableName(result), className, "@Table(name=\"prefix_table_name\")"); } return result; } HibernateNamingStrategy(StrategyOptions options); StrategyOptions getOptions(); void setOptions(StrategyOptions options); String classToTableName(String className); String propertyToColumnName(String propertyName); String embeddedPropertyToColumnName(String prefix, String embeddedPropertyName,
            boolean dontTouchPrefix); String joinTableName(String ownerEntityTable, String associatedEntityTable); String joinTableName(String ownerEntityTable, String associatedEntityTable,
            String ownerProperty); String joinKeyColumnName(String joinedColumn, String joinedTable); String foreignKeyColumnName(String propertyName, String propertyTableName); String foreignKeyConstraintName(String tableName, String columnName); String uniqueKeyConstraintName(String tableName, String columnName); }
HibernateNamingStrategy { public String classToTableName(String className) { String result = join(options.getTablePrefix(), classToPluralizedName(className)); if (needRestrict(options.isRestrictTableNames())) { return assertName(new NameShorter(options.getMaxLength(), options.hasTablePrefix()) .tableName(result), className, "@Table(name=\"prefix_table_name\")"); } return result; } HibernateNamingStrategy(StrategyOptions options); StrategyOptions getOptions(); void setOptions(StrategyOptions options); String classToTableName(String className); String propertyToColumnName(String propertyName); String embeddedPropertyToColumnName(String prefix, String embeddedPropertyName,
            boolean dontTouchPrefix); String joinTableName(String ownerEntityTable, String associatedEntityTable); String joinTableName(String ownerEntityTable, String associatedEntityTable,
            String ownerProperty); String joinKeyColumnName(String joinedColumn, String joinedTable); String foreignKeyColumnName(String propertyName, String propertyTableName); String foreignKeyConstraintName(String tableName, String columnName); String uniqueKeyConstraintName(String tableName, String columnName);  }