List of usage examples for org.hibernate.internal.util StringHelper unqualify
public static String unqualify(String qualifiedName)
From source file:com.devnexus.ting.core.hibernate.ImprovedPluralizedNamingStrategy.java
License:Apache License
/** * Return the unqualified class name, mixed case converted to * underscores//from w w w . j a v a 2s . c o m */ public String classToTableName(String className) { return addUnderscores(StringHelper.unqualify(className), true); }
From source file:com.devnexus.ting.core.hibernate.ImprovedPluralizedNamingStrategy.java
License:Apache License
/** * Return the full property path with underscore seperators, mixed * case converted to underscores/* w ww .ja v a2 s. c om*/ */ public String propertyToColumnName(String propertyName) { return addUnderscores(StringHelper.unqualify(propertyName)); }
From source file:com.devnexus.ting.core.hibernate.ImprovedPluralizedNamingStrategy.java
License:Apache License
/** * Return the property name or propertyTableName *///from w w w.j a va2 s .co m public String foreignKeyColumnName(String propertyName, String propertyEntityName, String propertyTableName, String referencedColumnName) { String header = propertyName != null ? StringHelper.unqualify(propertyName) : propertyTableName; if (header == null) { throw new AssertionFailure("NamingStrategy not properly filled"); } return columnName(header); //+ "_" + referencedColumnName not used for backward compatibility }
From source file:com.devnexus.ting.core.hibernate.ImprovedPluralizedNamingStrategy.java
License:Apache License
/** * Return the column name or the unqualified property name *///from ww w .j a va 2 s. c o m public String logicalColumnName(String columnName, String propertyName) { return StringHelper.isNotEmpty(columnName) ? columnName : StringHelper.unqualify(propertyName); }
From source file:com.devnexus.ting.core.hibernate.ImprovedPluralizedNamingStrategy.java
License:Apache License
/** * Returns either the table name if explicit or * if there is an associated table, the concatenation of owner entity table and associated table * otherwise the concatenation of owner entity table and the unqualified property name *///from ww w . j ava 2 s .c o m public String logicalCollectionTableName(String tableName, String ownerEntityTable, String associatedEntityTable, String propertyName) { if (tableName != null) { return tableName; } else { //use of a stringbuffer to workaround a JDK bug return new StringBuffer(Noun.pluralOf(ownerEntityTable, Locale.ENGLISH)).append("_") .append(associatedEntityTable != null ? Noun.pluralOf(associatedEntityTable, Locale.ENGLISH) : StringHelper.unqualify(propertyName)) .toString(); } }
From source file:com.devnexus.ting.core.hibernate.ImprovedPluralizedNamingStrategy.java
License:Apache License
/** * Return the column name if explicit or the concatenation of the property name and the referenced column *//*from www . j a v a 2 s . co m*/ public String logicalCollectionColumnName(String columnName, String propertyName, String referencedColumn) { return StringHelper.isNotEmpty(columnName) ? columnName : StringHelper.unqualify(propertyName) + "_" + referencedColumn; }
From source file:com.iisigroup.cap.jdbc.support.CapNamingStrategy.java
License:Open Source License
public String classToTableName(String className) { return (new StringBuilder()).append(TABLE_PREFIX).append(StringHelper.unqualify(className)).toString(); }
From source file:io.gumga.application.spring.config.GumgaNamingStrategy.java
@Override public String classToTableName(String string) { String table = StringHelper.unqualify(string); return oracleSafe(table).toUpperCase(); }
From source file:io.gumga.application.spring.config.GumgaNamingStrategy.java
@Override public String collectionTableName(String ownerEntity, String ownerEntityTable, String associatedEntity, String associatedEntityTable, String propertyName) { return tableName(new StringBuilder(ownerEntityTable).append("_").append( associatedEntityTable != null ? associatedEntityTable : StringHelper.unqualify(propertyName)) .toString());// w w w. java 2 s.c o m }
From source file:io.gumga.application.spring.config.GumgaNamingStrategy.java
@Override public String foreignKeyColumnName(String propertyName, String propertyEntityName, String propertyTableName, String referencedColumnName) { String header = propertyName != null ? StringHelper.unqualify(propertyName) : propertyTableName; Objects.requireNonNull(header, "GumgaNamingStrategy not properly filled on foreignKeyColumnName"); return columnName(header + "_" + referencedColumnName); }