KickJava   Java API By Example, From Geeks To Geeks.

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


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 cowsultants.itracker.ejb.client.models.IssueHistoryModel;
25
26 public abstract class IssueHistoryBean extends GenericBean {
27
28     public abstract String JavaDoc getDescription();
29     public abstract void setDescription(String JavaDoc value);
30
31     public abstract int getStatus();
32     public abstract void setStatus(int value);
33
34     public abstract IssueLocal getIssue();
35     public abstract void setIssue(IssueLocal value);
36
37     public abstract UserLocal getUser();
38     public abstract void setUser(UserLocal value);
39
40     public IssueHistoryModel getModel() {
41         IssueHistoryModel model = new IssueHistoryModel();
42         model.setId(this.getId());
43         model.setDescription(this.getDescription());
44         model.setStatus(this.getStatus());
45         model.setLastModifiedDate(this.getLastModifiedDate());
46         model.setCreateDate(this.getCreateDate());
47
48         model.setIssueId(this.getIssue().getId());
49
50         if(this.getUser() != null) {
51             model.setUser(this.getUser().getModel());
52         }
53
54         return model;
55     }
56
57     public void setModel(IssueHistoryModel model) {
58         this.setDescription(model.getDescription());
59         this.setStatus(model.getStatus());
60         this.setLastModifiedDate(new Timestamp JavaDoc(new Date().getTime()));
61     }
62
63 }
64
Popular Tags