Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Entity
- public class Category implements Serializable {
- @TableGenerator(
- name = "CategoryGenerator",
- allocationSize = 1,
- initialValue = 1)
- @Id
- @GeneratedValue(strategy = GenerationType.TABLE,
- generator="CategoryGenerator")
- @Column(name="categoryId")
- private Long categoryId;
- @Column(name="name")
- private String Name;
- public Category(){
- }
- public Category(Long categoryId, String name) {
- super();
- categoryId = categoryId;
- Name = name;
- }
- public Long getCategoryId() {
- return categoryId;
- }
- public void setCategoryId(Long categoryId) {
- categoryId = categoryId;
- }
- public String getName() {
- return Name;
- }
- public void setName(String name) {
- Name = name;
- }
- @Override
- public int hashCode() {
- int hash = 0;
- hash += (categoryId != null ? categoryId.hashCode() : 0);
- return hash;
- }
- @Override
- public boolean equals(Object object) {
- // TODO: Warning - this method won't work in the case the id fields are not set
- if (!(object instanceof Category)) {
- return false;
- }
- Category other = (Category) object;
- if ((this.categoryId == null && other.categoryId != null) || (this.categoryId != null && !this.categoryId.equals(other.categoryId))) {
- return false;
- }
- return true;
- }
- @Override
- public String toString() {
- return "model.Order[ id=" + categoryId + " ]";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment