/** * Copyright (c)2010-2011 Enterprise Website Content Management System(EWCMS), All rights reserved. * EWCMS PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. * http://www.ewcms.com */ package com.ewcms.common.dao.model; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Id; import javax.persistence.Entity; import javax.persistence.Table; /** * * @author wangwei */ @Entity @Table(name="test_jpa") public class Model implements Serializable { private static final long serialVersionUID = -1148051948275791827L; @Id @Column(name = "id") private Integer id; @Column(name = "title", nullable = false, length = 100) private String title; public Model() { } public Model(Integer id, String title) { this.id = id; this.title = title; } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } @Override public boolean equals(Object obj) { if (obj == null) { return false; } if (getClass() != obj.getClass()) { return false; } final Model other = (Model) obj; if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) { return false; } return true; } @Override public int hashCode() { int hash = 7; hash = 79 * hash + (this.id != null ? this.id.hashCode() : 0); return hash; } }