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.Collection;
10 import java.util.Objects;
11 import javax.persistence.Basic;
12 import javax.persistence.Column;
13 import javax.persistence.Entity;
14 import javax.persistence.GeneratedValue;
15 import javax.persistence.GenerationType;
16 import javax.persistence.Id;
17 import javax.persistence.NamedQueries;
18 import javax.persistence.NamedQuery;
19 import javax.persistence.OneToMany;
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;
25 import javax.xml.bind.annotation.XmlTransient;
32 @Table(name = "profile")
35 @NamedQuery(name = "Profile.findAll", query = "SELECT p FROM Profile p"),
36 @NamedQuery(name = "Profile.findById", query = "SELECT p FROM Profile p WHERE p.id = :id"),
37 @NamedQuery(name = "Profile.findByName", query = "SELECT p FROM Profile p WHERE p.name = :name")
39 public class Profile implements Serializable {
40 private static final long serialVersionUID = 1L;
42 @Basic(optional = false)
44 @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_GEN_SEQUENCE")
45 @SequenceGenerator(name = "SEQ_GEN_SEQUENCE", allocationSize = 50)
49 @Column(name = "name")
51 @OneToMany(mappedBy = "profileId")
52 private Collection<ProfileAttribute> profileAttributeCollection;
57 public Profile(Long id) {
65 public void setId(Long id) {
69 public String getName() {
73 public void setName(String name) {
78 public Collection<ProfileAttribute> getProfileAttributeCollection() {
79 return profileAttributeCollection;
82 public void setProfileAttributeCollection(Collection<ProfileAttribute> profileAttributeCollection) {
83 this.profileAttributeCollection = profileAttributeCollection;
87 public String toString() {
88 return "com.edf.gde.entities.Profile[ id=" + id + " ]";
92 public int hashCode() {
94 hash = 83 * hash + Objects.hashCode(this.id);
95 hash = 83 * hash + Objects.hashCode(this.name);
96 hash = 83 * hash + Objects.hashCode(this.profileAttributeCollection);
101 public boolean equals(Object obj) {
105 if (getClass() != obj.getClass()) {
108 final Profile other = (Profile) obj;
109 if (!Objects.equals(this.id, other.id)) {