userrole.java

来自「Strut数据库开发中的JSF项目」· Java 代码 · 共 97 行

JAVA
97
字号
package com.relationinfo.model;

import java.io.Serializable;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;

/**
 * This class is used to represent available roles in the database.</p>
 *
 * <p><a href="UserRole.java.html"><i>www.relationinfo.com</i></a></p>
 *
 * @author Jeff cao
 *
 * @struts.form extends="BaseForm"
 * @hibernate.class table="userrole"
 */
public class UserRole extends BaseObject implements Serializable {
	private static final long serialVersionUID = 3690197650654049848L;
	private String rolecode;
    private String userid;


    public UserRole() {}
    
    public UserRole(String rolecode,String userid) {
        this.rolecode = rolecode;
        this.userid=userid;
    }
    
    //~ Methods ================================================================

    /**
     * Returns the rolecode.
     * @return String
     *
     * @struts.validator type="required"
     * @hibernate.id column="rolecode" length="20"
     *   generator-class="assigned" unsaved-value="version"
     */
    public String getRolecode() {
        return this.rolecode;
    }

    /**
     * Returns the userid.
     * @return String
     *
     * @struts.validator type="required"
     * @hibernate.property column="userid"
     */
    public String getUserid() {
        return this.userid;
    }

    public void setRolecode(String rolecode) {
        this.rolecode = rolecode;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

   
    /**
     * Generated using Commonclipse (http://commonclipse.sf.net)
     */
    public boolean equals(Object object) {
        if (!(object instanceof Role)) {
            return false;
        }
        UserRole rhs = (UserRole) object;
        return new EqualsBuilder().append(this.userid, rhs.userid)
                .append(this.rolecode, rhs.rolecode).isEquals();
    }

    /**
     * Generated using Commonclipse (http://commonclipse.sf.net)
     */
    public int hashCode() {
        return new HashCodeBuilder(1156335803, 987569255).append(
                this.userid).append(this.rolecode).toHashCode();
    }
    
    /**
     * Generated using Commonclipse (http://commonclipse.sf.net)
     */
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                .append("rolecode", this.rolecode).append("userid",
                        this.userid).toString();
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?