Fix repo url retrieval
[validation.git] / ui / src / main / java / org / akraino / validation / ui / entity / BlueprintInstance.java
1 /*
2  * Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may
5  * not use this file except in compliance with the License. You may obtain
6  * a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
13  * implied. See the License for the specific language governing
14  * permissions and limitations under the License.
15  */
16 package org.akraino.validation.ui.entity;
17
18 import java.io.Serializable;
19 import java.util.HashSet;
20 import java.util.Set;
21
22 import javax.persistence.CascadeType;
23 import javax.persistence.Column;
24 import javax.persistence.Entity;
25 import javax.persistence.FetchType;
26 import javax.persistence.GeneratedValue;
27 import javax.persistence.GenerationType;
28 import javax.persistence.Id;
29 import javax.persistence.JoinColumn;
30 import javax.persistence.JoinTable;
31 import javax.persistence.ManyToMany;
32 import javax.persistence.ManyToOne;
33 import javax.persistence.Table;
34
35 @Entity
36 @Table(name = "blueprint_instance")
37 public class BlueprintInstance implements Serializable {
38
39     /**
40      *
41      */
42     private static final long serialVersionUID = 1L;
43
44     @Id
45     @GeneratedValue(strategy = GenerationType.IDENTITY)
46     @Column(name = "id")
47     private int blueprintInstId;
48
49     @ManyToOne
50     @JoinColumn(name = "blueprint_id")
51     private Blueprint blueprint;
52
53     @Column(name = "version")
54     private String version;
55
56     @ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
57     @JoinTable(name = "blueprint_instance_blueprint_layer", joinColumns = {
58             @JoinColumn(name = "blueprint_instance_id") }, inverseJoinColumns = {
59                     @JoinColumn(name = "blueprint_layer_id") })
60     private Set<BlueprintLayer> blueprintLayers = new HashSet<>();
61
62     public int getBlueprintInstanceId() {
63         return blueprintInstId;
64     }
65
66     public void setBlueprintInstanceId(int blueprintInstId) {
67         this.blueprintInstId = blueprintInstId;
68     }
69
70     public Blueprint getBlueprint() {
71         return blueprint;
72     }
73
74     public void setBlueprint(Blueprint blueprint) {
75         this.blueprint = blueprint;
76     }
77
78     public void setVersion(String version) {
79         this.version = version;
80     }
81
82     public String getVersion() {
83         return version;
84     }
85
86     public Set<BlueprintLayer> getBlueprintLayers() {
87         return blueprintLayers;
88     }
89
90     public void setBlueprintLayers(Set<BlueprintLayer> blueprintLayers) {
91         this.blueprintLayers = blueprintLayers;
92     }
93
94 }