@Override public Identifier determineBasicColumnName(ImplicitBasicColumnNameSource source) { // JPA states we should use the following as default: // "The property or field name" // aka: // The unqualified attribute path. return toIdentifier( transformAttributePath( source.getAttributePath() ), source.getBuildingContext() ); }
@Override public Identifier determineBasicColumnName(ImplicitBasicColumnNameSource source) { return source.isCollectionElement() ? toIdentifier( "elt", source.getBuildingContext() ) : super.determineBasicColumnName( source ); }
/** * Generates a name for a table column. */ @Override public Identifier determineBasicColumnName(ImplicitBasicColumnNameSource source) { AttributePath attributePath = source.getAttributePath(); String propertyName = getPropertyName(attributePath); String parentPropertyName = getPropertyName(attributePath.getParent()); Ejb3Column column = getEjb3Column(source); // generate a name for an embedded column if (isEmbedded(column)) { String fluentNamePrefix = getFluentNamePrefix(column, parentPropertyName); boolean hasEmbeddedPrefix = !InternalUtils.StringUtils.isEmpty(fluentNamePrefix); String prefix = hasEmbeddedPrefix ? fluentNamePrefix : parentPropertyName; boolean dontTouchPrefix = hasEmbeddedPrefix; return toIdentifier( strategy.embeddedPropertyToColumnName(prefix, propertyName, dontTouchPrefix), source); } // It is a strange behaviour for collection associations. // For an example for a "roles" association Hibernate uses "roles.element". if (!InternalUtils.StringUtils.isEmpty(parentPropertyName) && propertyName.equals("element")) { return toIdentifier(propertyName, source); } // Hibernate calls this method the first time for @Embedded column, but doesn't use a result return toIdentifier(strategy.propertyToColumnName(propertyName), source); }
@Override public Identifier determineBasicColumnName(ImplicitBasicColumnNameSource source) { return toIdentifier( "PTCN_" + source.getAttributePath().getProperty(), source.getBuildingContext() ); }
@Override public Identifier determineBasicColumnName(ImplicitBasicColumnNameSource source) { return source.isCollectionElement() ? toIdentifier( "elt", source.getBuildingContext() ) : super.determineBasicColumnName( source ); }
@Override public Identifier determineBasicColumnName(ImplicitBasicColumnNameSource source) { // JPA states we should use the following as default: // "The property or field name" // aka: // The unqualified attribute path. return toIdentifier( transformAttributePath( source.getAttributePath() ), source.getBuildingContext() ); }
@Override public Identifier determineBasicColumnName(ImplicitBasicColumnNameSource source) { AttributePath attributePath = source.getAttributePath(); String propertyName = getPropertyName(attributePath); String result = hibernate4Strategy.propertyToColumnName(propertyName); return toIdentifier(result, source.getBuildingContext()); }
@Override public Identifier determineBasicColumnName(ImplicitBasicColumnNameSource source) { String columnName = source.getAttributePath().getProperty(); String fullPath = source.getAttributePath().getFullPath(); String result; if (fullPath.startsWith("credentials.") || fullPath.startsWith("activation.")) { //credentials and activation are embedded and doesn't need to be qualified return super.determineBasicColumnName(source); } else { if (fullPath.contains("&&")) { // it's collection result = columnName; } else { result = fullPath.replaceAll("\\.", "_"); } } result = RUtil.fixDBSchemaObjectNameLength(result); Identifier i = toIdentifier(result, source.getBuildingContext()); LOGGER.trace("determineBasicColumnName {} {}", fullPath, i); return i; } }