Methods Summary |
---|
public java.lang.String | classToTableName(java.lang.String className)Return the unqualified class name
return StringHelper.unqualify(className);
|
public java.lang.String | collectionTableName(java.lang.String ownerEntity, java.lang.String ownerEntityTable, java.lang.String associatedEntity, java.lang.String associatedEntityTable, java.lang.String propertyName)Return the unqualified property name, not the best strategy but a backward compatible one
//use a degenerated strategy for backward compatibility
return StringHelper.unqualify(propertyName);
|
public java.lang.String | columnName(java.lang.String columnName)Return the argument
return columnName;
|
public java.lang.String | foreignKeyColumnName(java.lang.String propertyName, java.lang.String propertyEntityName, java.lang.String propertyTableName, java.lang.String referencedColumnName)Return the property name or propertyTableName
String header = propertyName != null ? StringHelper.unqualify( propertyName ) : propertyTableName;
if (header == null) throw new AssertionFailure("NammingStrategy not properly filled");
return columnName( header ); //+ "_" + referencedColumnName not used for backward compatibility
|
public java.lang.String | joinKeyColumnName(java.lang.String joinedColumn, java.lang.String joinedTable)Return the argument
return columnName( joinedColumn );
|
public java.lang.String | logicalCollectionColumnName(java.lang.String columnName, java.lang.String propertyName, java.lang.String referencedColumn)Return the column name if explicit or the concatenation of the property name and the referenced column
return StringHelper.isNotEmpty( columnName ) ? columnName : propertyName + "_" + referencedColumn;
|
public java.lang.String | logicalCollectionTableName(java.lang.String tableName, java.lang.String ownerEntityTable, java.lang.String associatedEntityTable, java.lang.String propertyName)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
if ( tableName != null ) {
return tableName;
}
else {
//use of a stringbuffer to workaround a JDK bug
return new StringBuffer(ownerEntityTable).append("_")
.append(
associatedEntityTable != null ?
associatedEntityTable :
StringHelper.unqualify( propertyName )
).toString();
}
|
public java.lang.String | logicalColumnName(java.lang.String columnName, java.lang.String propertyName)Return the column name or the unqualified property name
return StringHelper.isNotEmpty( columnName ) ? columnName : StringHelper.unqualify( propertyName );
|
public java.lang.String | propertyToColumnName(java.lang.String propertyName)Return the unqualified property name
return StringHelper.unqualify(propertyName);
|
public java.lang.String | tableName(java.lang.String tableName)Return the argument
return tableName;
|