/*
* Hibernate, Relational Persistence for Idiomatic Java
*
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
*/
package org.hibernate.test.ops;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
/**
* @author Gail Badner
*/
public class Item {
private Long id;
private int version;
private String name;
private Category category;
private List<SubItem> subItemsBackref = new ArrayList<SubItem>();
private Set<String> colors = new HashSet<String>();
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public int getVersion() {
return version;
}
public void setVersion(int version) {
this.version = version;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Category getCategory() {
return category;
}
public void setCategory(Category category) {
this.category = category;
}
public Set<String> getColors() {
return colors;
}
public void setColors(Set<String> colors) {
this.colors = colors;
}
public List<SubItem> getSubItemsBackref() {
return subItemsBackref;
}
public void setSubItemsBackref(List<SubItem> subItemsBackref) {
this.subItemsBackref = subItemsBackref;
}
@Override
public boolean equals(Object o) {
if ( this == o ) {
return true;
}
if ( o == null || getClass() != o.getClass() ) {
return false;
}
Item item = (Item) o;
if ( !name.equals( item.name ) ) {
return false;
}
return true;
}
@Override
public int hashCode() {
return name.hashCode();
}
@Override
public String toString() {
return "Item{" +
"id=" + id +
", version=" + version +
", name='" + name + '\'' +
//", category=" + category +
//", subItems=" + subItems +
'}';
}
}