package com.sishuok.mvc.entity; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; import java.io.Serializable; /** * <p>User: Zhang Kaitao * <p>Date: 13-12-26 * <p>Version: 1.0 */ @XmlRootElement(name = "user") @XmlAccessorType(XmlAccessType.FIELD) public class User implements Serializable { @XmlElement(name = "id") private Long id; @XmlElement(name = "name") private String name; public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; User user = (User) o; if (id != null ? !id.equals(user.id) : user.id != null) return false; return true; } @Override public int hashCode() { return id != null ? id.hashCode() : 0; } }