@Override public void populateForeignKeyColumn(ValueMapping vm, String name, Table local, Table foreign, Column col, Object target, boolean inverse, int pos, int cols) { boolean elem = vm == vm.getFieldMapping().getElement() && vm.getFieldMapping().getTypeCode() != JavaTypes.MAP; // if this is a non-inverse collection element key, it must be in // a join table: if we're not prepending the field name, leave the // default if (!_prependFieldNameToJoinTableInverseJoinColumns && !inverse && elem) return; // otherwise jpa always uses <field>_<pkcol> for column name, even // when only one col if (target instanceof Column) { if (elem) name = vm.getFieldMapping().getName(); if (isRemoveHungarianNotation()) name = removeHungarianNotation(name); name = name + "_" + ((Column) target).getName(); // No need to check for uniqueness. name = dict.getValidColumnName(name, local, false); col.setName(name); } }
public void populateForeignKeyColumn(ValueMapping vm, DBIdentifier sName, Table local, Table foreign, Column col, Object target, boolean inverse, int pos, int cols) { boolean elem = vm == vm.getFieldMapping().getElement() && vm.getFieldMapping().getTypeCode() != JavaTypes.MAP; // if this is a non-inverse collection element key, it must be in // a join table: if we're not prepending the field name, leave the // default if (!_prependFieldNameToJoinTableInverseJoinColumns && !inverse && elem) return; // otherwise jpa always uses <field>_<pkcol> for column name, even // when only one col if (target instanceof Column) { if (DBIdentifier.isNull(sName)) { sName = col.getIdentifier(); } else { if (elem) sName = DBIdentifier.newColumn(vm.getFieldMapping().getName()); if (isRemoveHungarianNotation()) sName = DBIdentifier.newColumn(Normalizer.removeHungarianNotation(sName.getName())); sName = sName.combine(sName, ((Column)target).getIdentifier().getName()); // No need to check for uniqueness. sName = dict.getValidColumnName(sName, local, false); } col.setIdentifier(sName); } }
public void populateForeignKeyColumn(ValueMapping vm, DBIdentifier sName, Table local, Table foreign, Column col, Object target, boolean inverse, int pos, int cols) { boolean elem = vm == vm.getFieldMapping().getElement() && vm.getFieldMapping().getTypeCode() != JavaTypes.MAP; // if this is a non-inverse collection element key, it must be in // a join table: if we're not prepending the field name, leave the // default if (!_prependFieldNameToJoinTableInverseJoinColumns && !inverse && elem) return; // otherwise jpa always uses <field>_<pkcol> for column name, even // when only one col if (target instanceof Column) { if (DBIdentifier.isNull(sName)) { sName = col.getIdentifier(); } else { if (elem) sName = DBIdentifier.newColumn(vm.getFieldMapping().getName()); if (isRemoveHungarianNotation()) sName = DBIdentifier.newColumn(Normalizer.removeHungarianNotation(sName.getName())); sName = sName.combine(sName, ((Column)target).getIdentifier().getName()); // No need to check for uniqueness. sName = dict.getValidColumnName(sName, local, false); } col.setIdentifier(sName); } }
public void populateForeignKeyColumn(ValueMapping vm, DBIdentifier sName, Table local, Table foreign, Column col, Object target, boolean inverse, int pos, int cols) { boolean elem = vm == vm.getFieldMapping().getElement() && vm.getFieldMapping().getTypeCode() != JavaTypes.MAP; // if this is a non-inverse collection element key, it must be in // a join table: if we're not prepending the field name, leave the // default if (!_prependFieldNameToJoinTableInverseJoinColumns && !inverse && elem) return; // otherwise jpa always uses <field>_<pkcol> for column name, even // when only one col if (target instanceof Column) { if (DBIdentifier.isNull(sName)) { sName = col.getIdentifier(); } else { if (elem) sName = DBIdentifier.newColumn(vm.getFieldMapping().getName()); if (isRemoveHungarianNotation()) sName = DBIdentifier.newColumn(Normalizer.removeHungarianNotation(sName.getName())); sName = sName.combine(sName, ((Column)target).getIdentifier().getName()); // No need to check for uniqueness. sName = dict.getValidColumnName(sName, local, false); } col.setIdentifier(sName); } }