Package ejava.examples.orm.rel.annotated
Class Borrower
- java.lang.Object
-
- ejava.examples.orm.rel.annotated.Borrower
-
@Entity public class Borrower extends Object
This class forms a uni-directional, one-to-one relationship with the Person class, joined by common primary keys. There is not additional column necessary to store the foreign key. Note too that this object fully encapsulates the relationship by never handing over the Person; only using it to derive values. All concenience getters are declared Transient.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addCheckout(Checkout checkout)
Applicant
getApplication()
Collection<Checkout>
getCheckouts()
Date
getEndDate()
long
getId()
String
getName()
This method returns the concatenated first/last names of the Borrower's person.Date
getStartDate()
private String
myInstance()
void
removeCheckout(Checkout checkout)
void
setApplication(Applicant application)
void
setEndDate(Date end)
void
setStartDate(Date start)
String
toString()
-
-
-
Constructor Detail
-
Borrower
protected Borrower()
-
Borrower
public Borrower(Person identity)
-
-
Method Detail
-
getId
public long getId()
-
getEndDate
public Date getEndDate()
-
setEndDate
public void setEndDate(Date end)
-
getStartDate
public Date getStartDate()
-
setStartDate
public void setStartDate(Date start)
-
getName
public String getName()
This method returns the concatenated first/last names of the Borrower's person. Note that we need to declare this field Transient so that the provider doesn't try to map this to a column in the Borrower table as well as look for a setName.
-
getApplication
public Applicant getApplication()
-
setApplication
public void setApplication(Applicant application)
-
getCheckouts
public Collection<Checkout> getCheckouts()
-
addCheckout
public void addCheckout(Checkout checkout)
-
removeCheckout
public void removeCheckout(Checkout checkout)
-
myInstance
private String myInstance()
-
-