@Override public void redefineColumnName(String columnName, String propertyName, boolean applyNamingStrategy) { if ( StringHelper.isNotEmpty( columnName ) ) { getMappingColumn().setName( applyNamingStrategy ? getMappings().getNamingStrategy().columnName( columnName ) : 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 ) ); } } }
/** * Generates a name for @DiscriminatorColumn. Hibernate doesn't use this method because of an * issue. Hiibernate generates "DTYPE" name for the discriminator column. Hibernate 4 uses * ImprovedNamingStrategy#columnName() to convert "DTYPE" to "dtype". */ @Override public Identifier determineDiscriminatorColumnName( ImplicitDiscriminatorColumnNameSource source) { String discriminatorColumnName = Ejb3DiscriminatorColumn.DEFAULT_DISCRIMINATOR_COLUMN_NAME; String result = hibernate4Strategy.columnName(discriminatorColumnName); return toIdentifier(result, source.getBuildingContext()); }
/** * Generates a name for @OrderColumn. Hibernate doesn't use this method because of an issue. * Hibernate 5 generates "booksOrdered_ORDER", opposite "books_ordered_order" is generated by * Hibernate 4 ImprovedNamingStrategy. */ @Override public Identifier determineListIndexColumnName(ImplicitIndexColumnNameSource source) { String propertyName = getPropertyName(source.getPluralAttributePath()); String orderColumnName = propertyName + ORDER_COLUMN_POSTFIX; String result = hibernate4Strategy.columnName(orderColumnName); return toIdentifier(result, source.getBuildingContext()); }
/** * This method is not used by Hibernate for @MapKeyColumn because of an issue. Hibernate 5 * generates "booksMap_KEY", opposite "books_map_key" is generated by Hibernate 4 * ImprovedNamingStrategy. */ @Override public Identifier determineMapKeyColumnName(ImplicitMapKeyColumnNameSource source) { String propertyName = getPropertyName(source.getPluralAttributePath()); String orderColumnName = propertyName + KEY_COLUMN_POSTFIX; String result = hibernate4Strategy.columnName(orderColumnName); return toIdentifier(result, source.getBuildingContext()); }
@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 ); } }
@Override public void redefineColumnName(String columnName, String propertyName, boolean applyNamingStrategy) { if ( StringHelper.isNotEmpty( columnName ) ) { getMappingColumn().setName( applyNamingStrategy ? getMappings().getNamingStrategy().columnName( columnName ) : columnName ); } }
public void redefineColumnName(String columnName, String propertyName, boolean applyNamingStrategy) { if ( applyNamingStrategy ) { if ( StringHelper.isEmpty( columnName ) ) { if ( propertyName != null ) { mappingColumn.setName( mappings.getNamingStrategy().propertyToColumnName( propertyName ) ); } //Do nothing otherwise } else { mappingColumn.setName( mappings.getNamingStrategy().columnName( columnName ) ); } } else { if ( StringHelper.isNotEmpty( columnName ) ) mappingColumn.setName( columnName ); } }
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
columnName, propertyPath ); column.setName( mappings.getNamingStrategy().columnName( columnName ) ); if ( table != null ) { columnName, propertyPath ); column.setName( mappings.getNamingStrategy().columnName( columnName ) ); if ( table != null ) {
columnName, propertyPath ); column.setName( mappings.getNamingStrategy().columnName( columnName ) ); if ( table != null ) { columnName, propertyPath ); column.setName( mappings.getNamingStrategy().columnName( columnName ) ); if ( table != null ) {
columnElement.attributeValue( "name" ), propertyPath ); column.setName( mappings.getNamingStrategy().columnName( logicalColumnName ) ); if ( table != null ) { columnAttribute.getValue(), propertyPath ); column.setName( mappings.getNamingStrategy().columnName( logicalColumnName ) ); if ( table != null ) {
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 ) ); } } }
private Column makeColumn(ColumnSource columnSource, TableSpecification table) { String name = columnSource.getName(); name = metadata.getOptions().getNamingStrategy().columnName( name ); name = quoteIdentifier( name ); final Column column = table.locateOrCreateColumn( name ); column.setNullable( columnSource.isNullable() ); column.setDefaultValue( columnSource.getDefaultValue() ); column.setSqlType( columnSource.getSqlType() ); column.setSize( columnSource.getSize() ); column.setDatatype( columnSource.getDatatype() ); column.setReadFragment( columnSource.getReadFragment() ); column.setWriteFragment( columnSource.getWriteFragment() ); column.setUnique( columnSource.isUnique() ); column.setCheckCondition( columnSource.getCheckCondition() ); column.setComment( columnSource.getComment() ); return column; }
private Column makeColumn(ColumnSource columnSource, TableSpecification table) { String name = columnSource.getName(); name = metadata.getOptions().getNamingStrategy().columnName( name ); name = quoteIdentifier( name ); final Column column = table.locateOrCreateColumn( name ); column.setNullable( columnSource.isNullable() ); column.setDefaultValue( columnSource.getDefaultValue() ); column.setSqlType( columnSource.getSqlType() ); column.setSize( columnSource.getSize() ); column.setDatatype( columnSource.getDatatype() ); column.setReadFragment( columnSource.getReadFragment() ); column.setWriteFragment( columnSource.getWriteFragment() ); column.setUnique( columnSource.isUnique() ); column.setCheckCondition( columnSource.getCheckCondition() ); column.setComment( columnSource.getComment() ); return column; }