AccountProperty.java 2.76 KB
package org.legrog.entities;

import javax.persistence.*;

/*
    Entité persistente représentant la codification des propriétés qui peuvent être paramétrées pour un utilisateur.
    Importée depuis la v2.
 */
@Entity
public class AccountProperty {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)  /* Permet la population */
    private int userPropertyId;

    /**
     *
     * hibernate.id
     *  	generator-class="identity"
     *  	column="ID_PROP"
     *  	access="property"
     */
    public Integer getUserPropertyId() {
        return userPropertyId;
    }

    /**
     * The property name.
     */
    private String name;

    /**
     * Returns the property name.
     * @return the {@link String} attribute identifier.
     * @see #setName(String)
     * hibernate.property
     *  	column="ATTR_NAME"
     *  	not-null="true"
     *      unique="true"
     *  	access="property"
     *  	length="50"
     */
    public String getName() {
        return name;
    }

    /**
     * Initializes the property name.
     * @param name the new {@link String} identifier.
     * @see #getName()
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * The property tag.
     */
    private String tag;

    /**
     * Returns the property tag.
     * @return the {@link String} value.
     * @see #setTag(String)
     * hibernate.property
     *  	column="PROP_TAG"
     *  	access="property"
     *  	length="100"
     */
    public String getTag() {
        return tag;
    }

    /**
     * Initializes property tag.
     * @param tag the new {@link String} tag.
     * @see #getTag()
     */
    public void setTag(String tag) {
        this.tag = tag;
    }

    /**
     * The property validation status.
     * A property may be temporarily deactivated.
     */
    private boolean visible;

    /**
     * Indicates if the property is visible / usable.
     * If not, users should not be able to access the privileges
     * they inherit from having this property set.
     * @return the visible flag.
     * @see #setVisible(boolean)
     * hibernate.property
     *  	column="IND_VISIBLE"
     *  	access="property"
     */
    public boolean isVisible() {
        return visible;
    }

    /**
     * Initializes the property visible flag.
     * @param visible the new flag value.
     * @see #isVisible
     */
    public void setVisible(boolean visible) {
        this.visible = visible;
    }

    /**
     * Returns a string representation of this property definition.
     * @return a string representing this property definition.
     * hidden
     */
    @Override
    public String toString()
    {

        return "ID_PROP=" + getUserPropertyId() + "PROP_NAME=" + name + " PROP_TAG=" + tag + " IND_VISIBLE=" + visible;
    }

}