2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
6 package com.edf.gde.entities;
8 import java.io.Serializable;
9 import java.util.Objects;
10 import javax.persistence.Basic;
11 import javax.persistence.Column;
12 import javax.persistence.Entity;
13 import javax.persistence.GeneratedValue;
14 import javax.persistence.GenerationType;
15 import javax.persistence.Id;
16 import javax.persistence.JoinColumn;
17 import javax.persistence.ManyToOne;
18 import javax.persistence.NamedQueries;
19 import javax.persistence.NamedQuery;
20 import javax.persistence.SequenceGenerator;
21 import javax.persistence.Table;
22 import javax.validation.constraints.NotNull;
23 import javax.validation.constraints.Size;
24 import javax.xml.bind.annotation.XmlRootElement;
31 @Table(name = "profile_attribute")
34 @NamedQuery(name = "ProfileAttribute.findAll", query = "SELECT p FROM ProfileAttribute p"),
35 @NamedQuery(name = "ProfileAttribute.findById", query = "SELECT p FROM ProfileAttribute p WHERE p.id = :id"),
36 @NamedQuery(name = "ProfileAttribute.findByName", query = "SELECT p FROM ProfileAttribute p WHERE p.name = :name"),
37 @NamedQuery(name = "ProfileAttribute.findByType", query = "SELECT p FROM ProfileAttribute p WHERE p.type = :type"),
38 //@NamedQuery(name = "ProfileAttribute.findByMandatory", query = "SELECT p FROM ProfileAttribute p WHERE p.mandatory = :mandatory")
40 public class ProfileAttribute implements Serializable {
41 private static final long serialVersionUID = 1L;
43 @Basic(optional = false)
45 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_GEN_SEQUENCE")
46 @SequenceGenerator(name = "SEQ_GEN_SEQUENCE", allocationSize = 50)
50 @Column(name = "name")
53 @Column(name = "type")
55 @Column(name = "mandatory")
56 private Boolean mandatory;
57 @JoinColumn(name = "profile_id", referencedColumnName = "id", nullable = false)
59 private Profile profileId;
61 public ProfileAttribute() {
64 public ProfileAttribute(Long id) {
72 public void setId(Long id) {
76 public String getName() {
80 public void setName(String name) {
84 public String getType() {
88 public void setType(String type) {
92 public Boolean getMandatory() {
96 public void setMandatory(Boolean mandatory) {
97 this.mandatory = mandatory;
100 public Profile getProfileId() {
104 public void setProfileId(Profile profileId) {
105 this.profileId = profileId;
109 public String toString() {
110 return "com.edf.gde.entities.ProfileAttribute[ id=" + id + " ]";
114 public int hashCode() {
116 hash = 71 * hash + Objects.hashCode(this.id);
117 hash = 71 * hash + Objects.hashCode(this.name);
118 hash = 71 * hash + Objects.hashCode(this.type);
119 hash = 71 * hash + Objects.hashCode(this.mandatory);
120 hash = 71 * hash + Objects.hashCode(this.profileId);
125 public boolean equals(Object obj) {
129 if (getClass() != obj.getClass()) {
132 final ProfileAttribute other = (ProfileAttribute) obj;
133 if (!Objects.equals(this.id, other.id)) {