1
2
3
4
5
6
7
8
9
10
11 package com.atlassian.jira.util.entities;
12
13 import java.util.Map;
14
15 import org.ofbiz.core.entity.GenericEntityException;
16 import org.ofbiz.core.util.UtilMisc;
17
18 import com.atlassian.core.ofbiz.CoreFactory;
19
20
21
22
23
24
25
26
27
28
29
30 public class Component extends Entity {
31
32 private String url;
33 private String lead;
34 private int project;
35 private long assigneeType;
36
37
38
39 protected String getType() {
40 return "Component";
41 }
42
43 public int getNewId() throws NumberFormatException, GenericEntityException {
44 return CoreFactory.getGenericDelegator().getNextSeqId(getType()).intValue();
45 }
46
47
48
49 protected void addFields(Map _fields) {
50 super.addFields(_fields);
51 _fields.put("assigneetype", getAssigneeType());
52 _fields.put("lead", getLead());
53 _fields.put("project", getProject());
54 _fields.put("url", getUrl());
55 }
56
57
58
59
60
61 public Long getAssigneeType() {
62 return new Long(assigneeType);
63 }
64
65
66
67
68 public String getLead() {
69 return lead;
70 }
71
72
73
74
75 public Long getProject() {
76 return new Long(project);
77 }
78
79
80
81
82 public String getUrl() {
83 return url;
84 }
85
86
87
88
89 public void setAssigneeType(long i) {
90 assigneeType = i;
91 }
92
93
94
95
96 public void setLead(String string) {
97 lead = string;
98 }
99
100
101
102
103 public void setProject(int i) {
104 project = i;
105 }
106
107
108
109
110 public void setUrl(String string) {
111 url = string;
112 }
113
114
115
116 public boolean exist() throws GenericEntityException {
117 return !(CoreFactory.getGenericDelegator().findByAnd(getType(), UtilMisc.toMap("project", String.valueOf(getProject()),"name", String.valueOf(getName()) ) ).size() == 0);
118 }
119
120
121
122 public boolean doStorage() throws GenericEntityException {
123 return !exist();
124 }
125
126 }