Package relations

Class Deity

  • All Implemented Interfaces:
    java.io.Serializable

    @Entity
    public class Deity
    extends java.lang.Object
    implements java.io.Serializable
    An entity that contains relations corresponding to family tree relations. This entity demonstrates the following JPA features: 1. Enum fields (gender) 2. @OneToOne relations 3. @OneToMany relations 4. Named queries
    See Also:
    Serialized Form
    • Constructor Detail

      • Deity

        public Deity​(java.lang.String name,
                     Deity.Gender gender)
    • Method Detail

      • giveBirth

        public Deity giveBirth​(java.lang.String childName,
                               Deity childFather,
                               Deity.Gender gender)
        She's having a baby...
        Parameters:
        childName - the baby name
        Returns:
        the new child
        Throws:
        java.lang.IllegalArgumentException - if the person is not a woman, or if the person is unmarried (illegitimate children are not yet supported)
      • setName

        public void setName​(java.lang.String name)
      • getName

        public java.lang.String getName()
      • setGender

        public void setGender​(Deity.Gender gender)
      • setMother

        public void setMother​(Deity mother)
      • getMother

        public Deity getMother()
      • setFather

        public void setFather​(Deity father)
      • getFather

        public Deity getFather()
      • setChildren

        public void setChildren​(java.util.Set<Deity> children)
      • getChildren

        public java.util.Set<Deity> getChildren()