relations
Class Deity

java.lang.Object
  extended by relations.Deity
All Implemented Interfaces:
Serializable

public class Deity
extends Object
implements 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

Nested Class Summary
static class Deity.Gender
           
 
Constructor Summary
Deity(String name, Deity.Gender gender)
           
 
Method Summary
 Set<Deity> getChildren()
           
 Deity getFather()
           
 Deity.Gender getGender()
           
 Deity getMother()
           
 String getName()
           
 Deity giveBirth(String childName, Deity childFather, Deity.Gender gender)
          She's having a baby...
 void setChildren(Set<Deity> children)
           
 void setFather(Deity father)
           
 void setGender(Deity.Gender gender)
           
 void setMother(Deity mother)
           
 void setName(String name)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Deity

public Deity(String name,
             Deity.Gender gender)
Method Detail

giveBirth

public Deity giveBirth(String childName,
                       Deity childFather,
                       Deity.Gender gender)
She's having a baby...

Parameters:
childName - the baby name
Returns:
the new child
Throws:
IllegalArgumentException - if the person is not a woman, or if the person is unmarried (illegitimate children are not yet supported)

setName

public void setName(String name)

getName

public String getName()

setGender

public void setGender(Deity.Gender gender)

getGender

public Deity.Gender getGender()

setMother

public void setMother(Deity mother)

getMother

public Deity getMother()

setFather

public void setFather(Deity father)

getFather

public Deity getFather()

setChildren

public void setChildren(Set<Deity> children)

getChildren

public Set<Deity> getChildren()


Copyright © 2006-2007 Apache Software Foundation. All Rights Reserved.