KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > ejb3 > test > regression > ejbthree440 > model > Resource


1 package org.jboss.ejb3.test.regression.ejbthree440.model;
2
3 import java.io.Serializable JavaDoc;
4 import java.util.Date JavaDoc;
5 import java.util.Set JavaDoc;
6
7 import javax.persistence.*;
8
9 @Entity
10 @Table(name="TBRESOURCE")
11 @Inheritance(strategy=InheritanceType.JOINED)
12 @DiscriminatorValue("R")
13 @DiscriminatorColumn(name="inhtype", length=2)
14 @TableGenerator(
15     name="RES_SEQ"
16 )
17 public class Resource implements Serializable JavaDoc{
18   private int id, version;
19   private Integer JavaDoc region;
20   private String JavaDoc description, skills;
21   private Date JavaDoc created, updated;
22   private Set JavaDoc<Location> locations;
23   private Set JavaDoc<ResourceLocation> resourceLocations;
24   private Set JavaDoc<Rescalendar> calendars;
25   private User user;
26   private boolean active;
27
28   @OneToMany(mappedBy="resource")
29   public Set JavaDoc<ResourceLocation> getResourceLocations() {
30     return resourceLocations;
31   }
32
33   public void setResourceLocations(Set JavaDoc<ResourceLocation> resourceLocations) {
34     this.resourceLocations = resourceLocations;
35   }
36
37   @Column(name="create_dt")
38   public Date JavaDoc getCreated() {
39     return created;
40   }
41
42   public void setCreated(Date JavaDoc created) {
43     this.created = created;
44   }
45
46   @Column(name="description")
47   public String JavaDoc getDescription() {
48     return description;
49   }
50
51   public void setDescription(String JavaDoc description) {
52     this.description = description;
53   }
54
55   @Id
56   @GeneratedValue(strategy=GenerationType.TABLE, generator="RES_SEQ")
57   public int getId() {
58     return id;
59   }
60
61   public void setId(int id) {
62     this.id = id;
63   }
64
65
66   public String JavaDoc getSkills() {
67     return skills;
68   }
69
70   public void setSkills(String JavaDoc skills) {
71     this.skills = skills;
72   }
73
74   @Column(name="update_dt")
75   public Date JavaDoc getUpdated() {
76     return updated;
77   }
78
79   public void setUpdated(Date JavaDoc updated) {
80     this.updated = updated;
81   }
82
83   @Version
84   @Column(name="versionnr")
85   public int getVersion() {
86     return version;
87   }
88
89   public void setVersion(int version) {
90     this.version = version;
91   }
92
93   public Integer JavaDoc getRegion() {
94     return region;
95   }
96
97   public void setRegion(Integer JavaDoc region) {
98     this.region = region;
99   }
100
101   @OneToMany(mappedBy="resource")
102   public Set JavaDoc<Rescalendar> getCalendars() {
103     return calendars;
104   }
105
106   public void setCalendars(Set JavaDoc<Rescalendar> calendars) {
107     this.calendars = calendars;
108   }
109
110   @ManyToOne(fetch=FetchType.LAZY)
111   public User getUser() {
112     return user;
113   }
114
115   public void setUser(User user) {
116     this.user = user;
117   }
118
119   public boolean isActive() {
120     return active;
121   }
122
123   public void setActive(boolean active) {
124     this.active = active;
125   }
126 }
127
Popular Tags