/** * Creates Primary Key. * * @param ref External Reference. * @param xref Castor XRef. */ private void createPrimaryKey(ExternalReference ref, XrefType xref) { DbReferenceType primaryRef = new DbReferenceType(); primaryRef.setDb(ref.getDatabase()); primaryRef.setId(ref.getId()); xref.setPrimaryRef(primaryRef); }
/** * Creates Secondary Key. * * @param ref External Reference * @param xref Castro XRef. */ private void createSecondaryKey(ExternalReference ref, XrefType xref) { DbReferenceType secondaryRef = new DbReferenceType(); secondaryRef.setDb(ref.getDatabase()); secondaryRef.setId(ref.getId()); xref.getSecondaryRef().add(secondaryRef); }
/** * Generates XRef Key. * * @param ref External Reference * @return Hash Key. */ private String generateXRefKey(ExternalReference ref) { return ref.getDatabase() + "." + ref.getId(); }