Beispiel #1
0
  /**
   * Adds new attribute to the entity. If attribute has no name, IllegalArgumentException is thrown.
   *
   * <p>Also sets <code>attr</code>'s entity to be this entity.
   */
  public void addAttribute(Attribute attr) {
    if (attr.getName() == null) {
      throw new IllegalArgumentException("Attempt to insert unnamed attribute.");
    }

    attributes.put(attr.getName(), attr);
  }
Beispiel #2
0
 /** Adds new relationship to the entity. */
 public void addRelationship(Relationship rel) {
   relationships.put(rel.getName(), rel);
 }