relations
Class Deity
java.lang.Object
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Deity
public Deity(String name,
Deity.Gender gender)
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.