1 package org.jboss.ejb3.test.regression.ejbthree440.model; 2 3 import java.io.Serializable ; 4 import java.util.Date ; 5 import java.util.Set ; 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 { 18 private int id, version; 19 private Integer region; 20 private String description, skills; 21 private Date created, updated; 22 private Set <Location> locations; 23 private Set <ResourceLocation> resourceLocations; 24 private Set <Rescalendar> calendars; 25 private User user; 26 private boolean active; 27 28 @OneToMany(mappedBy="resource") 29 public Set <ResourceLocation> getResourceLocations() { 30 return resourceLocations; 31 } 32 33 public void setResourceLocations(Set <ResourceLocation> resourceLocations) { 34 this.resourceLocations = resourceLocations; 35 } 36 37 @Column(name="create_dt") 38 public Date getCreated() { 39 return created; 40 } 41 42 public void setCreated(Date created) { 43 this.created = created; 44 } 45 46 @Column(name="description") 47 public String getDescription() { 48 return description; 49 } 50 51 public void setDescription(String 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 getSkills() { 67 return skills; 68 } 69 70 public void setSkills(String skills) { 71 this.skills = skills; 72 } 73 74 @Column(name="update_dt") 75 public Date getUpdated() { 76 return updated; 77 } 78 79 public void setUpdated(Date 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 getRegion() { 94 return region; 95 } 96 97 public void setRegion(Integer region) { 98 this.region = region; 99 } 100 101 @OneToMany(mappedBy="resource") 102 public Set <Rescalendar> getCalendars() { 103 return calendars; 104 } 105 106 public void setCalendars(Set <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 |