package org.taobao88.taobao.enterprise.entity;
import java.io.Serializable;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
@Entity
@Table(name = "images")
public class Images implements Serializable {
/**
*
*/
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "image_id")
private int imageId;
@Column(name = "image_name")
private String imageName;
@ManyToMany(fetch = FetchType.LAZY, mappedBy = "images")
private Set<Recomendation> recomendations;
public int getImageId() {
return imageId;
}
public void setImageId(int imageId) {
this.imageId = imageId;
}
public String getImageName() {
return imageName;
}
public void setImageName(String imageName) {
this.imageName = imageName;
}
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
result = prime * result + imageId;
result = prime * result + ((imageName == null) ? 0 : imageName.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;
Images other = (Images) obj;
if (imageId != other.imageId)
return false;
if (imageName == null) {
if (other.imageName != null)
return false;
} else if (!imageName.equals(other.imageName))
return false;
if (recomendations == null) {
if (other.recomendations != null)
return false;
} else if (!recomendations.equals(other.recomendations))
return false;
return true;
}
public Set<Recomendation> getRecomendations() {
return recomendations;
}
public void setRecomendations(Set<Recomendation> recomendations) {
this.recomendations = recomendations;
}
}