void assertDefault(ForeignKey fk) { boolean isDefault = StringUtils.isEmpty(fk.name()) && fk.enabled() && !fk.deferred() && fk.deleteAction() == ForeignKeyAction.RESTRICT && fk.updateAction() == ForeignKeyAction.RESTRICT && fk.columnNames().length == 0 && fk.specified(); if (!isDefault) throw new UserException(_loc.get("implicit-non-default-fk", _cls, getSourceFile()).getMessage()); }
/** * Parse the given foreign key. */ private void parseForeignKey(MappingInfo info, ForeignKey fk) { if (!fk.implicit()) { parseForeignKey(info, fk.name(), fk.enabled(), fk.deferred(), fk.deleteAction(), fk.updateAction()); } else { info.setImplicitRelation(true); assertDefault(fk); } }
/** * Parse the given foreign key. */ private void parseForeignKey(MappingInfo info, ForeignKey fk) { parseForeignKey(info, fk.name(), fk.enabled(), fk.deferred(), fk.deleteAction(), fk.updateAction()); }
/** * Parse @ContainerTable. */ protected void parseContainerTable(FieldMapping fm, ContainerTable ctbl) { fm.getMappingInfo().setTableName(toTableName(ctbl.schema(), ctbl.name())); parseXJoinColumns(fm, fm.getMappingInfo(), false, ctbl.joinColumns()); if (ctbl.joinForeignKey().specified()) parseForeignKey(fm.getMappingInfo(), ctbl.joinForeignKey()); if (ctbl.joinIndex().specified()) parseIndex(fm.getMappingInfo(), ctbl.joinIndex()); }
/** * Parse @ContainerTable. */ protected void parseContainerTable(FieldMapping fm, ContainerTable ctbl) { DBIdentifier tblName = toTableIdentifier(ctbl.schema(), ctbl.name()); fm.getMappingInfo().setTableIdentifier(tblName); parseXJoinColumns(fm, fm.getMappingInfo(), false, ctbl.joinColumns()); if (ctbl.joinForeignKey().specified()) parseForeignKey(fm.getMappingInfo(), ctbl.joinForeignKey()); if (ctbl.joinIndex().specified()) parseIndex(fm.getMappingInfo(), ctbl.joinIndex()); }
void assertDefault(ForeignKey fk) { boolean isDefault = StringUtil.isEmpty(fk.name()) && fk.enabled() && !fk.deferred() && fk.deleteAction() == ForeignKeyAction.RESTRICT && fk.updateAction() == ForeignKeyAction.RESTRICT && fk.columnNames().length == 0 && fk.specified(); if (!isDefault) throw new UserException(_loc.get("implicit-non-default-fk", _cls, getSourceFile()).getMessage()); }
/** * Parse @ContainerTable. */ protected void parseContainerTable(FieldMapping fm, ContainerTable ctbl) { DBIdentifier tblName = toTableIdentifier(ctbl.schema(), ctbl.name()); fm.getMappingInfo().setTableIdentifier(tblName); parseXJoinColumns(fm, fm.getMappingInfo(), false, ctbl.joinColumns()); if (ctbl.joinForeignKey().specified()) parseForeignKey(fm.getMappingInfo(), ctbl.joinForeignKey()); if (ctbl.joinIndex().specified()) parseIndex(fm.getMappingInfo(), ctbl.joinIndex()); }
void assertDefault(ForeignKey fk) { boolean isDefault = StringUtil.isEmpty(fk.name()) && fk.enabled() && !fk.deferred() && fk.deleteAction() == ForeignKeyAction.RESTRICT && fk.updateAction() == ForeignKeyAction.RESTRICT && fk.columnNames().length == 0 && fk.specified(); if (!isDefault) throw new UserException(_loc.get("implicit-non-default-fk", _cls, getSourceFile()).getMessage()); }
/** * Parse the given foreign key. */ private void parseForeignKey(MappingInfo info, ForeignKey fk) { if (!fk.implicit()) { parseForeignKey(info, fk.name(), fk.enabled(), fk.deferred(), fk.deleteAction(), fk.updateAction()); } else { info.setImplicitRelation(true); assertDefault(fk); } }
/** * Parse @ContainerTable. */ protected void parseContainerTable(FieldMapping fm, ContainerTable ctbl) { DBIdentifier tblName = toTableIdentifier(ctbl.schema(), ctbl.name()); fm.getMappingInfo().setTableIdentifier(tblName); parseXJoinColumns(fm, fm.getMappingInfo(), false, ctbl.joinColumns()); if (ctbl.joinForeignKey().specified()) parseForeignKey(fm.getMappingInfo(), ctbl.joinForeignKey()); if (ctbl.joinIndex().specified()) parseIndex(fm.getMappingInfo(), ctbl.joinIndex()); }
/** * Parse the given foreign key. */ private void parseForeignKey(MappingInfo info, ForeignKey fk) { if (!fk.implicit()) { parseForeignKey(info, fk.name(), fk.enabled(), fk.deferred(), fk.deleteAction(), fk.updateAction()); } else { info.setImplicitRelation(true); assertDefault(fk); } }