package com.jthink.skyeye.data.jpa.pk;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import java.io.Serializable;
/**
* JThink@JThink
*
* @author JThink
* @version 0.0.1
* @desc name info的联合主键
* @date 2016-11-17 09:17:19
*/
@Embeddable
public class NameInfoPK implements Serializable {
@Column(name = "name", nullable = false)
private String name;
@Column(name = "type", nullable = false)
private String type;
public NameInfoPK() {
}
public NameInfoPK(String name, String type) {
this.name = name;
this.type = type;
}
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
NameInfoPK that = (NameInfoPK) o;
if (name != null ? !name.equals(that.name) : that.name != null) return false;
return type != null ? type.equals(that.type) : that.type == null;
}
@Override
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + (type != null ? type.hashCode() : 0);
return result;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
}