当前位置:编程学习 > JSP >>

appfuse1.7帮助中创建DAO段代码

/* * Created on 2005-4-21 */package org.appfuse.model;
import org.apache.commons.lang.builder.EqualsBuilder;import org.apache.commons.lang.builder.HashCodeBuilder;import org.apache.commons.lang.builder.ToStringBuilder;
/** * @hibernate.class table="person" */public class Person extends BaseObject {
 private Long id;
 private String firstName;
 private String lastName;
 /**  * @return Returns the firstName.  * @hibernate.property column="first_name" length="50"  */ public String getFirstName() {  return firstName; }
 /**  * @param firstName  *                     The firstName to set.  */ public void setFirstName(String firstName) {  this.firstName = firstName; }
 /**  * @return Returns the id.  * @hibernate.id column="id" generator-class="native" unsaved-value="null"  */ public Long getId() {  return id; }
 /**  * @param id  *                     The id to set.  */ public void setId(Long id) {  this.id = id; }
 /**  * @return Returns the lastName.  * @hibernate.property column="last_name" length="50"  */ public String getLastName() {  return lastName; }
 /**  * @param lastName  *                     The lastName to set.  */ public void setLastName(String lastName) {  this.lastName = lastName; }
 /**  * @see java.lang.Object#equals(Object)  */ public boolean equals(Object object) {  if (!(object instanceof Person)) {   return false;  }  Person rhs = (Person) object;  return new EqualsBuilder()     .append(this.firstName, rhs.firstName)     .append(this.id, rhs.id)     .append(this.lastName, rhs.lastName).isEquals(); } /**  *     public boolean equals(Object object) {        if (!(object instanceof Address)) {            return false;        }
补充:Jsp教程,Java技巧及代码
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,