/**
   * Creates a Primary Reference.
   *
   * @param database Database.
   * @param id ID String.
   * @return Castor XRef object
   */
  private XrefType createXRef(String database, String id) {
    XrefType xref = new XrefType();
    DbReferenceType primaryRef = new DbReferenceType();
    primaryRef.setDb(database);
    primaryRef.setId(id);
    xref.setPrimaryRef(primaryRef);

    return xref;
  }
 /**
  * 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);
 }
 /**
  * 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);
 }