Back to project page swazam.
The source code is released under:
MIT License
If you think the Android project swazam listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package ac.tuwien.sa13.entity; /*from ww w . j a v a 2 s . c o m*/ import java.util.ArrayList; import java.util.List; import javax.persistence.Entity; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; import org.hibernate.annotations.Cascade; import org.hibernate.annotations.CascadeType; import com.fasterxml.jackson.annotation.JsonIgnore; @Entity @Table(name = "transaction") public class Transaction { @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "user_id") @JsonIgnore private User user; @ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "request_id") private Request request; private Boolean isReward; public Transaction() { } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public User getUser() { return user; } public void setUser(User user) { this.user = user; } public Request getRequest() { return request; } public void setRequest(Request request) { this.request = request; } public Boolean getIsReward() { return isReward; } public void setIsReward(Boolean isReward) { this.isReward = isReward; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((isReward == null) ? 0 : isReward.hashCode()); result = prime * result + ((request == null) ? 0 : request.hashCode()); result = prime * result + ((user == null) ? 0 : user.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Transaction other = (Transaction) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; if (isReward == null) { if (other.isReward != null) return false; } else if (!isReward.equals(other.isReward)) return false; if (request == null) { if (other.request != null) return false; } else if (!request.equals(other.request)) return false; if (user == null) { if (other.user != null) return false; } else if (!user.equals(other.user)) return false; return true; } @Override public String toString() { return "Transaction [id=" + id + ", user=" + user + ", request=" + request + ", isReward=" + isReward + "]"; } }