628
|
1 |
/*
|
|
2 |
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
package com.nokia.helium.metadata.model.metadata;
|
|
18 |
|
|
19 |
import java.util.List;
|
|
20 |
|
|
21 |
import javax.persistence.CascadeType;
|
|
22 |
import javax.persistence.Column;
|
|
23 |
import javax.persistence.Entity;
|
|
24 |
import javax.persistence.GeneratedValue;
|
|
25 |
import javax.persistence.GenerationType;
|
|
26 |
import javax.persistence.Id;
|
|
27 |
import javax.persistence.JoinColumn;
|
|
28 |
import javax.persistence.ManyToOne;
|
|
29 |
import javax.persistence.OneToMany;
|
|
30 |
|
|
31 |
/**
|
|
32 |
* System definition unit.
|
|
33 |
*
|
|
34 |
*/
|
|
35 |
@SuppressWarnings("PMD.UnusedPrivateField")
|
|
36 |
@Entity
|
|
37 |
public class SysdefUnit {
|
|
38 |
@Id
|
|
39 |
@GeneratedValue(strategy = GenerationType.SEQUENCE)
|
|
40 |
@Column(name = "UNIT_ID")
|
|
41 |
private int id;
|
|
42 |
|
|
43 |
@Column(name = "LOCATION", nullable = false, length = 4096)
|
|
44 |
private String location;
|
|
45 |
|
|
46 |
@Column(name = "COMPONENT_ID", insertable = false, updatable = false, nullable = false)
|
|
47 |
private int componentId;
|
|
48 |
|
|
49 |
@ManyToOne(cascade = CascadeType.REMOVE)
|
|
50 |
@JoinColumn(name = "COMPONENT_ID", referencedColumnName = "COMPONENT_ID")
|
|
51 |
private SysdefComponent sysdefComponent;
|
|
52 |
|
|
53 |
@OneToMany
|
|
54 |
@JoinColumn(name = "UNIT_ID", referencedColumnName = "UNIT_ID")
|
|
55 |
private List<Component> components;
|
|
56 |
|
|
57 |
|
|
58 |
public void setId(int id) {
|
|
59 |
this.id = id;
|
|
60 |
}
|
|
61 |
|
|
62 |
public int getId() {
|
|
63 |
return id;
|
|
64 |
}
|
|
65 |
|
|
66 |
public void setLocation(String location) {
|
|
67 |
this.location = location;
|
|
68 |
}
|
|
69 |
|
|
70 |
public String getLocation() {
|
|
71 |
return location;
|
|
72 |
}
|
|
73 |
|
|
74 |
public void setComponentId(int componentId) {
|
|
75 |
this.componentId = componentId;
|
|
76 |
}
|
|
77 |
|
|
78 |
public int getComponentId() {
|
|
79 |
return componentId;
|
|
80 |
}
|
|
81 |
|
|
82 |
public void setSysdefComponent(SysdefComponent sysdefComponent) {
|
|
83 |
this.sysdefComponent = sysdefComponent;
|
|
84 |
}
|
|
85 |
|
|
86 |
public SysdefComponent getSysdefComponent() {
|
|
87 |
return sysdefComponent;
|
|
88 |
}
|
|
89 |
}
|