]> SALOME platform Git repositories - modules/gde.git/blob - projects/GDE_App/GDE-ejb/src/java/com/edf/gde/entities/UserGroup.java
Salome HOME
(no commit message)
[modules/gde.git] / projects / GDE_App / GDE-ejb / src / java / com / edf / gde / entities / UserGroup.java
1 package com.edf.gde.entities;
2
3 import javax.persistence.Basic;
4 import javax.persistence.Column;
5 import javax.persistence.Entity;
6 import javax.persistence.GeneratedValue;
7 import javax.persistence.GenerationType;
8 import javax.persistence.Id;
9 import javax.persistence.NamedQueries;
10 import javax.persistence.NamedQuery;
11 import javax.persistence.SequenceGenerator;
12 import javax.persistence.Table;
13 import javax.validation.constraints.NotNull;
14
15 /**
16  *
17  * @author kavoos
18  */
19 @Entity(name="UserGroup")
20 @Table(name = "USERGROUP")
21 @NamedQueries ({
22     @NamedQuery(name = "UserGroup.findById", query = "SELECT ug FROM UserGroup ug where ug.id = :id"),
23     @NamedQuery(name = "UserGroup.findByUserId", query = "SELECT ug FROM UserGroup ug where ug.userId=:userId"),
24     @NamedQuery(name = "UserGroup.findByGroupId", query="SELECT ug FROM UserGroup ug where ug.groupId=:groupId"),
25     @NamedQuery(name = "UserGroup.findByGroupIdUserId",query="SELECT ug FROM UserGroup ug where ug.groupId=:groupId and ug.userId=:userId")
26 })
27 public class UserGroup {
28     @Id
29     @Basic(optional = false)
30     @NotNull
31     @Column(name = "id")
32     @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "SEQ_GEN_SEQUENCE")
33     @SequenceGenerator(name = "SEQ_GEN_SEQUENCE", allocationSize = 50)
34     private Long id;
35     @Column(name="userId")
36     long userId;
37     @Column(name = "groupId")
38     long groupId;
39
40     public UserGroup() {
41     }
42
43     public Long getId() {
44         return id;
45     }
46
47     public void setId(Long id) {
48         this.id = id;
49     }
50
51     public long getUserId() {
52         return userId;
53     }
54
55     public void setUserId(long userId) {
56         this.userId = userId;
57     }
58
59     public long getGroupId() {
60         return groupId;
61     }
62
63     public void setGroupId(long groupId) {
64         this.groupId = groupId;
65     }
66 }