628
|
1 |
|
|
2 |
/*
|
|
3 |
* Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies).
|
|
4 |
* All rights reserved.
|
|
5 |
* This component and the accompanying materials are made available
|
|
6 |
* under the terms of the License "Eclipse Public License v1.0"
|
|
7 |
* which accompanies this distribution, and is available
|
|
8 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
9 |
*
|
|
10 |
* Initial Contributors:
|
|
11 |
* Nokia Corporation - initial contribution.
|
|
12 |
*
|
|
13 |
* Contributors:
|
|
14 |
*
|
|
15 |
* Description:
|
|
16 |
*
|
|
17 |
*/
|
|
18 |
package com.nokia.helium.metadata.model.metadata;
|
|
19 |
|
|
20 |
import javax.persistence.Basic;
|
|
21 |
import javax.persistence.Column;
|
|
22 |
import javax.persistence.Entity;
|
|
23 |
import javax.persistence.GeneratedValue;
|
|
24 |
import javax.persistence.GenerationType;
|
|
25 |
import javax.persistence.Id;
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
/**
|
|
31 |
* Entity Class stores the severity.
|
|
32 |
*/
|
|
33 |
@Entity
|
|
34 |
public class Severity {
|
|
35 |
|
|
36 |
@Id
|
|
37 |
@GeneratedValue(strategy = GenerationType.SEQUENCE)
|
|
38 |
@Column(name = "SEVERITY_ID")
|
|
39 |
private int id;
|
|
40 |
|
|
41 |
@Basic
|
|
42 |
@Column(name = "SEVERITY")
|
|
43 |
private String severity;
|
|
44 |
|
|
45 |
|
|
46 |
/**
|
|
47 |
* Helper function to set the severity string.
|
|
48 |
* @param prty - severity string to be stored for this
|
|
49 |
* severity object.
|
|
50 |
*/
|
|
51 |
public void setSeverity(String severity) {
|
|
52 |
this.severity = severity.toUpperCase();
|
|
53 |
}
|
|
54 |
|
|
55 |
/**
|
|
56 |
* Helper function to get the severity of the severity object
|
|
57 |
* @return severity string of this severity object.
|
|
58 |
*/
|
|
59 |
public String getSeverity() {
|
|
60 |
return severity.toUpperCase();
|
|
61 |
}
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Set the identifier of this severity object in the database.
|
|
65 |
* @param id for this severity in the database
|
|
66 |
*/
|
|
67 |
public void setId(int identifier) {
|
|
68 |
id = identifier;
|
|
69 |
}
|
|
70 |
|
|
71 |
/**
|
|
72 |
* Gets the identifier of the severity object.
|
|
73 |
* @return id of this severity object.
|
|
74 |
*/
|
|
75 |
public int getId() {
|
|
76 |
return id;
|
|
77 |
}
|
|
78 |
|
|
79 |
} |