If you use Eclipse, Source -> Generate hashCode() and equals() generates
good implementations of these methods. You'll need to choose the fields
used: check just the id one.
On Wed, 06 Jul 2011 12:23:34 -0300, George Christman
<gchrist...@cardaddy.com> wrote:
Here's my Funding class
@Entity
public class Funding extends BaseEntity implements Labeled {
//BaseEntity is just the generated ID.
private String name;
private String label;
@OneToMany(mappedBy = "funding", cascade=CascadeType.ALL)
private List<LineItemFunding> lineItemFundings;
@ManyToOne
@JoinColumn(name = "ifas_object_code_id", nullable = true)
private IfasObjectCode ifasObjectCode;
@ManyToOne
@JoinColumn(name = "pr_id", nullable = false)
private PurchaseRequest purchaseRequest;
@Transient
private long tempId;
public Funding() {
tempId = UUID.randomUUID().getLeastSignificantBits();
}
public long getTempId() {
return tempId;
}
public void setTempId(long tempId) {
this.tempId = tempId;
}
public PurchaseRequest getPurchaseRequest() {
return purchaseRequest;
}
public void setPurchaseRequest(PurchaseRequest purchaseRequest) {
this.purchaseRequest = purchaseRequest;
}
public IfasObjectCode getIfasObjectCode() {
return ifasObjectCode;
}
public void setIfasObjectCode(IfasObjectCode ifasObjectCode) {
this.ifasObjectCode = ifasObjectCode;
}
public List<LineItemFunding> getLineItemFundings() {
return lineItemFundings;
}
public void setLineItemFundings(List<LineItemFunding>
lineItemFundings)
{
this.lineItemFundings = lineItemFundings;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLabel() {
return _name + " - " + _ifasObjectCode;
}
--
View this message in context:
http://tapestry.1045711.n5.nabble.com/T5-Selected-Attribute-tp4554181p4557089.html
Sent from the Tapestry - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org
--
Thiago H. de Paula Figueiredo
Independent Java, Apache Tapestry 5 and Hibernate consultant, developer,
and instructor
Owner, Ars Machina Tecnologia da Informação Ltda.
Consultor, desenvolvedor e instrutor em Java, Tapestry e Hibernate
http://www.arsmachina.com.br
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org