View Javadoc
1   package org.kuali.mobility.tours.entity;
2   
3   import javax.persistence.Basic;
4   import javax.persistence.Column;
5   import javax.persistence.Entity;
6   import javax.persistence.FetchType;
7   import javax.persistence.GeneratedValue;
8   import javax.persistence.GenerationType;
9   import javax.persistence.Id;
10  import javax.persistence.JoinColumn;
11  import javax.persistence.OneToOne;
12  import javax.persistence.SequenceGenerator;
13  import javax.persistence.Table;
14  import javax.xml.bind.annotation.XmlRootElement;
15  
16  @XmlRootElement( name = "permission")
17  @Entity(name="TourPermission")
18  @Table(name="TOUR_PRMSSN_T")
19  public class TourPermission {
20  
21  	@Id
22      //@SequenceGenerator(name="tour_permission_sequence", sequenceName="SEQ_TOUR_PRMSSN_T", initialValue=1000, allocationSize=1)
23      //@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="tour_permission_sequence")
24  	@GeneratedValue(strategy = GenerationType.TABLE)
25  	@Column(name="PRMSSN_ID")
26  	private Long permissionId;
27  	
28  	@Basic
29      @Column(name="TOUR_ID", insertable=false, updatable=false)
30  	private Long tourId;
31  
32      @OneToOne(fetch=FetchType.LAZY)
33      @JoinColumn(name="TOUR_ID", nullable=true)
34  	private Tour tour;
35      
36      @Column(name="PRMSSN_TYPE")
37  	private String type;
38      
39      @Column(name="GRP_NM")
40  	private String groupName;
41  
42  	public Long getPermissionId() {
43  		return permissionId;
44  	}
45  
46  	public void setPermissionId(Long permissionId) {
47  		this.permissionId = permissionId;
48  	}
49  
50  	public Long getTourId() {
51  		return tourId;
52  	}
53  
54  	public void setTourId(Long tourId) {
55  		this.tourId = tourId;
56  	}
57  
58  	public Tour getTour() {
59  		return tour;
60  	}
61  
62  	public void setTour(Tour tour) {
63  		this.tour = tour;
64  	}
65  
66  	public String getType() {
67  		return type;
68  	}
69  
70  	public void setType(String type) {
71  		this.type = type;
72  	}
73  
74  	public String getGroupName() {
75  		return groupName;
76  	}
77  
78  	public void setGroupName(String groupName) {
79  		this.groupName = groupName;
80  	}
81  
82  	public TourPermission copy(boolean includeIds) {
83  		TourPermission copy = new TourPermission();
84  		if (includeIds) {
85  			copy.setPermissionId(new Long(permissionId));
86  		}
87  		copy.setTourId(new Long(tourId));
88  		copy.setType(new String(type));
89  		copy.setGroupName(new String(groupName));
90  		return copy;
91  	}
92  }