com.jeefuse.system.security.model.GsysRelRoleFunction.java Source code

Java tutorial

Introduction

Here is the source code for com.jeefuse.system.security.model.GsysRelRoleFunction.java

Source

/**
 * Copyright (c) 2009-2013 jeefuse.com, Licensed under GPL (the "License")
 * Email:yonclv@gmail.com
 * PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
 */
package com.jeefuse.system.security.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.apache.commons.lang.builder.ToStringBuilder;
import org.apache.commons.lang.builder.ToStringStyle;
import org.hibernate.annotations.GenericGenerator;

import com.jeefuse.base.model.IdEntity;

/**
 * GsysRelRoleFunction Entity define.
 *
 * @author yonclv
 * @generated
 */
@Entity
@Table(name = "gsys_rel_role_function")
public class GsysRelRoleFunction implements IdEntity<String>, Serializable {
    /** @generated */
    private static final long serialVersionUID = 1L;

    /** @generated */
    public GsysRelRoleFunction() {
    }

    /**
     * ------------------------------------------------------------------------
     * id
     * ------------------------------------------------------------------------
     * @generated
     */
    @Id
    @GeneratedValue(generator = "hibernate-uuid")
    @GenericGenerator(strategy = "uuid", name = "hibernate-uuid")
    @Column(name = "ID", length = 32, unique = true, precision = 0, scale = 0, nullable = false, insertable = true, updatable = true)
    public String getId() {
        return id;
    }

    /** @generated */
    public void setId(final String id) {
        this.id = id;
    }

    private String id = null;

    /**
     * ------------------------------------------------------------------------
     * gsysRole
     * ------------------------------------------------------------------------
     * @generated
     */
    @JoinColumn(name = "ROLE_ID", unique = false, nullable = false, insertable = true, updatable = true)
    @ManyToOne(fetch = FetchType.LAZY)
    public GsysRole getGsysRole() {
        return gsysRole;
    }

    /** @generated */
    public void setGsysRole(final GsysRole gsysRole) {
        this.gsysRole = gsysRole;
    }

    /** @generated */
    private GsysRole gsysRole = null;

    /**
     * ------------------------------------------------------------------------
     * gsysFunction
     * ------------------------------------------------------------------------
     * @generated
     */
    @JoinColumn(name = "FUNCTION_ID", unique = false, nullable = false, insertable = true, updatable = true)
    @ManyToOne(fetch = FetchType.LAZY)
    public GsysFunction getGsysFunction() {
        return gsysFunction;
    }

    /** @generated */
    public void setGsysFunction(final GsysFunction gsysFunction) {
        this.gsysFunction = gsysFunction;
    }

    /** @generated */
    private GsysFunction gsysFunction = null;

    // ------------------------------------------------------------------------
    // Utils
    // ------------------------------------------------------------------------

    /** @generated */
    @Override
    public String toString() {
        return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
                // .append("id",id).append("gsysRole",gsysRole).append("gsysFunction",gsysFunction)
                .toString();
    }

    /** @generated */
    @Override
    public int hashCode() {
        final int PRIME = 31;
        int result = 1;
        result = PRIME * result + ((id == null) ? super.hashCode() : id.hashCode());
        return result;
    }

    /** @generated */
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (!(obj instanceof GsysRelRoleFunction))
            return false;
        final GsysRelRoleFunction other = (GsysRelRoleFunction) obj;
        if (id == null) {
            if (other.getId() != null)
                return false;
        } else if (!id.equals(other.getId()))
            return false;
        return true;
    }
}