9d153e2a2192e60be7d2300a571e177d7a8b7a0a
[portal.git] / ecomp-portal-widget-ms / widget-ms / src / main / java / org / onap / portalapp / widget / domain / WidgetCatalog.java
1 package org.onap.portalapp.widget.domain;
2
3 import java.util.Set;
4
5 import javax.persistence.CascadeType;
6 import javax.persistence.Column;
7 import javax.persistence.Entity;
8 import javax.persistence.FetchType;
9 import javax.persistence.GeneratedValue;
10 import javax.persistence.GenerationType;
11 import javax.persistence.Id;
12 import javax.persistence.JoinColumn;
13 import javax.persistence.JoinTable;
14 import javax.persistence.ManyToMany;
15 import javax.persistence.Table;
16 import javax.persistence.Transient;
17
18
19 @Entity
20 @Table(name="EP_WIDGET_CATALOG")
21 public class WidgetCatalog{
22         
23         @Id
24         @Column(name = "widget_id")
25         @GeneratedValue(strategy=GenerationType.AUTO)
26         private long id;
27         
28         @Column(name = "wdg_name")
29         private String name;
30         
31         @Column(name = "wdg_desc")
32         private String desc;    
33         
34         @Column(name = "wdg_file_loc")
35         private String fileLocation;
36         
37         @Column(name = "all_user_flag")
38         private String allowAllUser;
39         
40         @Column(name = "service_id")
41         private Long serviceId;
42         
43         @Transient
44         private String sortOrder;
45
46         @Transient
47         private String statusCode;
48
49         @ManyToMany(fetch = FetchType.EAGER, cascade = {CascadeType.MERGE, CascadeType.PERSIST, CascadeType.REFRESH})
50         @JoinTable(name = "ep_widget_catalog_role", 
51                         joinColumns = {@JoinColumn(name = "WIDGET_ID")},
52                         inverseJoinColumns = {@JoinColumn(name = "ROLE_ID")}
53         )
54         private Set<RoleApp> widgetRoles;
55
56         public long getId() {
57                 return id;
58         }
59
60         public void setId(long id) {
61                 this.id = id;
62         }
63
64         public String getName() {
65                 return name;
66         }
67
68         public void setName(String name) {
69                 this.name = name;
70         }
71
72         public String getDesc() {
73                 return desc;
74         }
75
76         public void setDesc(String desc) {
77                 this.desc = desc;
78         }
79
80         public String getFileLocation() {
81                 return fileLocation;
82         }
83
84         public void setFileLocation(String fileLocation) {
85                 this.fileLocation = fileLocation;
86         }
87
88         public Set<RoleApp> getWidgetRoles() {
89                 return widgetRoles;
90         }
91
92         public void setWidgetRoles(Set<RoleApp> widgetRoles) {
93                 this.widgetRoles = widgetRoles;
94         }
95         
96         public String getAllowAllUser() {
97                 return allowAllUser;
98         }
99
100         public void setAllowAllUser(String allowAllUser) {
101                 this.allowAllUser = allowAllUser;
102         }
103
104         public String getSortOrder() {
105                 return sortOrder;
106         }
107
108         public void setSortOrder(String sortOrder) {
109                 this.sortOrder = sortOrder;
110         }
111
112         public String getStatusCode() {
113                 return statusCode;
114         }
115
116         public void setStatusCode(String statusCode) {
117                 this.statusCode = statusCode;
118         }
119
120         public Long getServiceId() {
121                 return serviceId;
122         }
123
124         public void setServiceId(Long serviceId) {
125                 this.serviceId = serviceId;
126         }
127
128         @Override
129         public String toString() {
130                 return "WidgetCatalog [id=" + id + ", name=" + name + ", desc=" + desc + ", fileLocation=" + fileLocation
131                                 + ", allowAllUser=" + allowAllUser + ", serviceId=" + serviceId + ", sortOrder=" + sortOrder
132                                 + ", statusCode=" + statusCode + ", widgetRoles=" + widgetRoles + "]";
133         }
134 }