private static String getClassTableName(PersistentClass model, Element node, Mappings mappings) { Attribute tableNameNode = node.attribute( "table" ); if ( tableNameNode == null ) { return mappings.getNamingStrategy().classToTableName( model.getEntityName() ); } else { return mappings.getNamingStrategy().tableName( tableNameNode.getValue() ); } }
protected void addColumnBinding(SimpleValue value) { String logicalColumnName = mappings.getNamingStrategy() .logicalColumnName( this.logicalColumnName, propertyName ); mappings.addColumnBinding( logicalColumnName, getMappingColumn(), value.getTable() ); }
protected void addColumnBinding(SimpleValue value) { String logicalColumnName = mappings.getNamingStrategy() .logicalColumnName( this.logicalColumnName, propertyName ); mappings.addColumnBinding( logicalColumnName, getMappingColumn(), value.getTable() ); }
private static String getClassTableName( PersistentClass model, Element node, String schema, String catalog, Table denormalizedSuperTable, Mappings mappings ) { Attribute tableNameNode = node.attribute( "table" ); String logicalTableName; String physicalTableName; if ( tableNameNode == null ) { logicalTableName = StringHelper.unqualify( model.getEntityName() ); physicalTableName = mappings.getNamingStrategy().classToTableName( model.getEntityName() ); } else { logicalTableName = tableNameNode.getValue(); physicalTableName = mappings.getNamingStrategy().tableName( logicalTableName ); } mappings.addTableBinding( schema, catalog, logicalTableName, physicalTableName, denormalizedSuperTable ); return physicalTableName; }
private ObjectNameSource buildNameContext(String unquotedOwnerTable, String unquotedAssocTable) { String logicalName = mappings.getNamingStrategy().logicalCollectionTableName( name, unquotedOwnerTable, unquotedAssocTable, propertyName ); if ( StringHelper.isQuoted( ownerEntityTable ) || StringHelper.isQuoted( associatedEntityTable ) ) { logicalName = StringHelper.quote( logicalName ); } return new AssociationTableNameSource( name, logicalName ); }
@Override public void redefineColumnName(String columnName, String propertyName, boolean applyNamingStrategy) { if ( StringHelper.isNotEmpty( columnName ) ) { getMappingColumn().setName( applyNamingStrategy ? getMappings().getNamingStrategy().columnName( columnName ) : columnName ); } }
@Override public void redefineColumnName(String columnName, String propertyName, boolean applyNamingStrategy) { if ( StringHelper.isNotEmpty( columnName ) ) { getMappingColumn().setName( applyNamingStrategy ? getMappings().getNamingStrategy().columnName( columnName ) : columnName ); } }
private ObjectNameSource buildNameContext(String unquotedOwnerTable, String unquotedAssocTable) { String logicalName = mappings.getNamingStrategy().logicalCollectionTableName( name, unquotedOwnerTable, unquotedAssocTable, propertyName ); if ( StringHelper.isQuoted( ownerEntityTable ) || StringHelper.isQuoted( associatedEntityTable ) ) { logicalName = StringHelper.quote( logicalName ); } return new AssociationTableNameSource( name, logicalName ); }
private static String getClassTableName( PersistentClass model, Element node, String schema, String catalog, Table denormalizedSuperTable, Mappings mappings) { Attribute tableNameNode = node.attribute( "table" ); String logicalTableName; String physicalTableName; if ( tableNameNode == null ) { logicalTableName = StringHelper.unqualify( model.getEntityName() ); physicalTableName = mappings.getNamingStrategy().classToTableName( model.getEntityName() ); } else { logicalTableName = tableNameNode.getValue(); physicalTableName = mappings.getNamingStrategy().tableName( logicalTableName ); } mappings.addTableBinding( schema, catalog, logicalTableName, physicalTableName, denormalizedSuperTable ); return physicalTableName; }
private static String getClassTableName( PersistentClass model, Element node, String schema, String catalog, Table denormalizedSuperTable, Mappings mappings) { Attribute tableNameNode = node.attribute( "table" ); String logicalTableName; String physicalTableName; if ( tableNameNode == null ) { logicalTableName = StringHelper.unqualify( model.getEntityName() ); physicalTableName = mappings.getNamingStrategy().classToTableName( model.getEntityName() ); } else { logicalTableName = tableNameNode.getValue(); physicalTableName = mappings.getNamingStrategy().tableName( logicalTableName ); } mappings.addTableBinding( schema, catalog, logicalTableName, physicalTableName, denormalizedSuperTable ); return physicalTableName; }
public void redefineColumnName(String columnName, String propertyName, boolean applyNamingStrategy) { if ( applyNamingStrategy ) { if ( StringHelper.isEmpty( columnName ) ) { if ( propertyName != null ) { mappingColumn.setName( mappings.getObjectNameNormalizer().normalizeIdentifierQuoting( mappings.getNamingStrategy().propertyToColumnName( propertyName ) ) ); } //Do nothing otherwise } else { columnName = mappings.getObjectNameNormalizer().normalizeIdentifierQuoting( columnName ); columnName = mappings.getNamingStrategy().columnName( columnName ); columnName = mappings.getObjectNameNormalizer().normalizeIdentifierQuoting( columnName ); mappingColumn.setName( columnName ); } } else { if ( StringHelper.isNotEmpty( columnName ) ) { mappingColumn.setName( mappings.getObjectNameNormalizer().normalizeIdentifierQuoting( columnName ) ); } } }
public void redefineColumnName(String columnName, String propertyName, boolean applyNamingStrategy) { if ( applyNamingStrategy ) { if ( StringHelper.isEmpty( columnName ) ) { if ( propertyName != null ) { mappingColumn.setName( mappings.getObjectNameNormalizer().normalizeIdentifierQuoting( mappings.getNamingStrategy().propertyToColumnName( propertyName ) ) ); } //Do nothing otherwise } else { columnName = mappings.getObjectNameNormalizer().normalizeIdentifierQuoting( columnName ); columnName = mappings.getNamingStrategy().columnName( columnName ); columnName = mappings.getObjectNameNormalizer().normalizeIdentifierQuoting( columnName ); mappingColumn.setName( columnName ); } } else { if ( StringHelper.isNotEmpty( columnName ) ) { mappingColumn.setName( mappings.getObjectNameNormalizer().normalizeIdentifierQuoting( columnName ) ); } } }
bindColumn( columnElement, column, isNullable ); final String columnName = columnElement.attributeValue( "name" ); String logicalColumnName = mappings.getNamingStrategy().logicalColumnName( columnName, propertyPath ); column.setName( mappings.getNamingStrategy().columnName( columnName ) ); if ( table != null ) { String logicalColumnName = mappings.getNamingStrategy().logicalColumnName( columnName, propertyPath ); column.setName( mappings.getNamingStrategy().columnName( columnName ) ); if ( table != null ) { column.setValue( simpleValue ); bindColumn( node, column, isNullable ); column.setName( mappings.getNamingStrategy().propertyToColumnName( propertyPath ) ); String logicalName = mappings.getNamingStrategy().logicalColumnName( null, propertyPath ); mappings.addColumnBinding( logicalName, column, table );
bindColumn( columnElement, column, isNullable ); final String columnName = columnElement.attributeValue( "name" ); String logicalColumnName = mappings.getNamingStrategy().logicalColumnName( columnName, propertyPath ); column.setName( mappings.getNamingStrategy().columnName( columnName ) ); if ( table != null ) { String logicalColumnName = mappings.getNamingStrategy().logicalColumnName( columnName, propertyPath ); column.setName( mappings.getNamingStrategy().columnName( columnName ) ); if ( table != null ) { column.setValue( simpleValue ); bindColumn( node, column, isNullable ); column.setName( mappings.getNamingStrategy().propertyToColumnName( propertyPath ) ); String logicalName = mappings.getNamingStrategy().logicalColumnName( null, propertyPath ); mappings.addColumnBinding( logicalName, column, table );
column.setTypeIndex( count++ ); bindColumn( columnElement, column, isNullable ); column.setName( mappings.getNamingStrategy().columnName( columnElement.attributeValue( "name" ) ) ); if ( table != null ) table.addColumn( column ); // table=null -> an association column.setValue( simpleValue ); bindColumn( node, column, isNullable ); column.setName( mappings.getNamingStrategy().columnName( columnAttribute.getValue() ) ); if ( table != null ) table.addColumn( column ); // table=null -> an association - fill col.setValue( simpleValue ); bindColumn( node, col, isNullable ); col.setName( mappings.getNamingStrategy().propertyToColumnName( propertyPath ) ); simpleValue.getTable().addColumn( col ); simpleValue.addColumn( col );
final String ownerObjectName = JPA2ElementCollection && mappedByEntityName != null ? StringHelper.unqualify( mappedByEntityName ) : unquotedMappedbyTable; columnName = getMappings().getNamingStrategy().foreignKeyColumnName( mappedByPropertyName, mappedByEntityName, String logicalTableName = getMappings().getLogicalTableName( referencedEntity.getTable() ); String unquotedLogicalTableName = StringHelper.unquote( logicalTableName ); columnName = getMappings().getNamingStrategy().foreignKeyColumnName( getPropertyName(), referencedEntity.getEntityName(), columnName = getMappings().getNamingStrategy().joinKeyColumnName( unquotedLogicalReferenceColumn, unquotedLogicalTableName
final String ownerObjectName = JPA2ElementCollection && mappedByEntityName != null ? StringHelper.unqualify( mappedByEntityName ) : unquotedMappedbyTable; columnName = getMappings().getNamingStrategy().foreignKeyColumnName( mappedByPropertyName, mappedByEntityName, String logicalTableName = getMappings().getLogicalTableName( referencedEntity.getTable() ); String unquotedLogicalTableName = StringHelper.unquote( logicalTableName ); columnName = getMappings().getNamingStrategy().foreignKeyColumnName( getPropertyName(), referencedEntity.getEntityName(), columnName = getMappings().getNamingStrategy().joinKeyColumnName( unquotedLogicalReferenceColumn, unquotedLogicalTableName
@Override protected void addColumnBinding(SimpleValue value) { if ( StringHelper.isEmpty( mappedBy ) ) { String unquotedLogColName = StringHelper.unquote( getLogicalColumnName() ); String unquotedRefColumn = StringHelper.unquote( getReferencedColumn() ); String logicalColumnName = getMappings().getNamingStrategy() .logicalCollectionColumnName( unquotedLogColName, getPropertyName(), unquotedRefColumn ); if ( StringHelper.isQuoted( getLogicalColumnName() ) || StringHelper.isQuoted( getLogicalColumnName() ) ) { logicalColumnName = StringHelper.quote( logicalColumnName ); } getMappings().addColumnBinding( logicalColumnName, getMappingColumn(), value.getTable() ); } }
@Override protected void addColumnBinding(SimpleValue value) { if ( StringHelper.isEmpty( mappedBy ) ) { String unquotedLogColName = StringHelper.unquote( getLogicalColumnName() ); String unquotedRefColumn = StringHelper.unquote( getReferencedColumn() ); String logicalColumnName = getMappings().getNamingStrategy() .logicalCollectionColumnName( unquotedLogColName, getPropertyName(), unquotedRefColumn ); if ( StringHelper.isQuoted( getLogicalColumnName() ) || StringHelper.isQuoted( getLogicalColumnName() ) ) { logicalColumnName = StringHelper.quote( logicalColumnName ); } getMappings().addColumnBinding( logicalColumnName, getMappingColumn(), value.getTable() ); } }
: nameNormalizer.normalizeIdentifierQuoting( col.columnDefinition() ); final String tableName = ! StringHelper.isEmpty(col.table()) ? nameNormalizer.normalizeIdentifierQuoting( mappings.getNamingStrategy().tableName( col.table() ) ) : ""; final String columnName = nameNormalizer.normalizeIdentifierQuoting( col.name() );