KickJava   Java API By Example, From Geeks To Geeks.

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


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.IssueAttachmentModel;
25
26 public abstract class IssueAttachmentBean extends GenericBean {
27
28     public abstract String JavaDoc getOriginalFileName();
29     public abstract void setOriginalFileName(String JavaDoc value);
30
31     public abstract String JavaDoc getType();
32     public abstract void setType(String JavaDoc value);
33
34     public abstract String JavaDoc getFileName();
35     public abstract void setFileName(String JavaDoc value);
36
37     public abstract byte[] getFileData();
38     public abstract void setFileData(byte[] value);
39
40     public abstract String JavaDoc getDescription();
41     public abstract void setDescription(String JavaDoc value);
42
43     public abstract long getSize();
44     public abstract void setSize(long value);
45
46     public abstract IssueLocal getIssue();
47     public abstract void setIssue(IssueLocal value);
48
49     public abstract UserLocal getUser();
50     public abstract void setUser(UserLocal value);
51
52     public IssueAttachmentModel getModel() {
53         IssueAttachmentModel model = new IssueAttachmentModel();
54         model.setId(this.getId());
55         model.setOriginalFileName(this.getOriginalFileName());
56         model.setType(this.getType());
57         model.setFileName(this.getFileName());
58         model.setDescription(this.getDescription());
59         model.setSize(this.getSize());
60         model.setLastModifiedDate(this.getLastModifiedDate());
61         model.setCreateDate(this.getCreateDate());
62
63         model.setIssueId(this.getIssue().getId());
64
65         model.setUser(this.getUser().getModel());
66
67         return model;
68     }
69
70     public void setModel(IssueAttachmentModel model) {
71         this.setOriginalFileName(model.getOriginalFileName());
72         this.setType(model.getType());
73         this.setFileName(model.getFileName());
74         this.setSize(model.getSize());
75         this.setDescription(model.getDescription());
76         this.setLastModifiedDate(new Timestamp JavaDoc(new Date().getTime()));
77     }
78
79 }
80
Popular Tags