KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > cowsultants > itracker > ejb > beans > entity > IssueFieldBean


1 /*
2  * This software was designed and created by Jason Carroll.
3  * Copyright (c) 2002, 2003, 2004 Jason Carroll.
4  * The author can be reached at jcarroll@cowsultants.com
5  * ITracker website: http://www.cowsultants.com
6  * ITracker forums: http://www.cowsultants.com/phpBB/index.php
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it only under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  */

18
19 package cowsultants.itracker.ejb.beans.entity;
20
21 import java.util.*;
22 import java.sql.Timestamp JavaDoc;
23
24 import javax.ejb.EntityBean JavaDoc;
25 import javax.ejb.EntityContext JavaDoc;
26 import javax.ejb.FinderException JavaDoc;
27 import javax.ejb.CreateException JavaDoc;
28
29 import cowsultants.itracker.ejb.client.models.CustomFieldModel;
30 import cowsultants.itracker.ejb.client.models.IssueFieldModel;
31 import cowsultants.itracker.ejb.client.util.IssueUtilities;
32
33 public abstract class IssueFieldBean implements EntityBean JavaDoc {
34     private EntityContext JavaDoc ctx;
35
36     public abstract Integer JavaDoc getId();
37     public abstract void setId(Integer JavaDoc value);
38
39     public abstract String JavaDoc getStringValue();
40     public abstract void setStringValue(String JavaDoc value);
41
42     public abstract int getIntValue();
43     public abstract void setIntValue(int value);
44
45     public abstract Timestamp JavaDoc getDateValue();
46     public abstract void setDateValue(Timestamp JavaDoc value);
47
48     public abstract IssueLocal getIssue();
49     public abstract void setIssue(IssueLocal value);
50
51     public abstract CustomFieldLocal getCustomField();
52     public abstract void setCustomField(CustomFieldLocal value);
53
54     public IssueFieldModel getModel() {
55         IssueFieldModel model = new IssueFieldModel();
56         model.setId(this.getId());
57
58         model.setStringValue(this.getStringValue());
59         model.setIntValue(this.getIntValue());
60         model.setDateValue(this.getDateValue());
61
62         model.setIssueId(this.getIssue().getId());
63         model.setCustomField((this.getCustomField() != null) ? this.getCustomField().getModel() : new CustomFieldModel());
64
65         return model;
66     }
67
68     public void setModel(IssueFieldModel model) {
69         this.setStringValue(model.getStringValue());
70         this.setIntValue(model.getIntValue());
71         this.setDateValue((model.getDateValue() == null ? null : new Timestamp JavaDoc(model.getDateValue().getTime())));
72     }
73
74     public void setEntityContext(EntityContext JavaDoc value) {
75         ctx = value;
76     }
77
78     public void unsetEntityContext() {
79         ctx = null;
80     }
81
82     public Integer JavaDoc ejbCreate(Integer JavaDoc value) throws CreateException JavaDoc {
83         this.setId(value);
84         return null;
85     }
86
87     public void ejbPostCreate(Integer JavaDoc value) throws CreateException JavaDoc {
88     }
89
90     public void ejbActivate() {}
91
92     public void ejbPassivate() {}
93
94     public void ejbLoad() {}
95
96     public void ejbStore() {}
97
98     public void ejbRemove() {}
99
100 }
101
Popular Tags