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