QuotedID attrId = QuotedID.createIdFromDatabaseRecord(idfac, rs.getString("FKCOLUMN_NAME")); QuotedID refAttrId = QuotedID.createIdFromDatabaseRecord(idfac, rs.getString("PKCOLUMN_NAME")); builder.add(relation.getAttribute(attrId), ref.getAttribute(refAttrId));
QuotedID attrId = QuotedID.createIdFromDatabaseRecord(idfac, rs.getString("FKCOLUMN_NAME")); QuotedID refAttrId = QuotedID.createIdFromDatabaseRecord(idfac, rs.getString("PKCOLUMN_NAME")); builder.add(relation.getAttribute(attrId), ref.getAttribute(refAttrId));
builder.add(fkAttr, pkAttr);
builder.add(fkAttr, pkAttr);
/** * creates a single-attribute foreign key * * @param name * @param attribute * @param reference * @return */ public static ForeignKeyConstraint of(String name, Attribute attribute, Attribute reference) { return new Builder((DatabaseRelationDefinition)attribute.getRelation(), (DatabaseRelationDefinition)reference.getRelation()) .add(attribute, reference).build(name); }
/** * creates a single-attribute foreign key * * @param name * @param attribute * @param reference * @return */ public static ForeignKeyConstraint of(String name, Attribute attribute, Attribute reference) { return new Builder((DatabaseRelationDefinition)attribute.getRelation(), (DatabaseRelationDefinition)reference.getRelation()) .add(attribute, reference).build(name); }