KickJava   Java API By Example, From Geeks To Geeks.

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


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.ReportModel;
25
26 public abstract class ReportBean extends GenericBean {
27     public abstract String JavaDoc getName();
28     public abstract void setName(String JavaDoc value);
29
30     public abstract String JavaDoc getNameKey();
31     public abstract void setNameKey(String JavaDoc value);
32
33     public abstract String JavaDoc getDescription();
34     public abstract void setDescription(String JavaDoc value);
35
36     public abstract int getDataType();
37     public abstract void setDataType(int value);
38
39     public abstract int getReportType();
40     public abstract void setReportType(int value);
41
42     public abstract byte[] getFileData();
43     public abstract void setFileData(byte[] value);
44
45     public abstract String JavaDoc getClassName();
46     public abstract void setClassName(String JavaDoc value);
47
48     public ReportModel getModel() {
49         ReportModel model = new ReportModel();
50         model.setId(this.getId());
51         model.setName(this.getName());
52         model.setNameKey(this.getNameKey());
53         model.setDescription(this.getDescription());
54         model.setDataType(this.getDataType());
55         model.setReportType(this.getReportType());
56         model.setClassName(this.getClassName());
57
58         model.setLastModifiedDate(this.getLastModifiedDate());
59         model.setCreateDate(this.getCreateDate());
60
61         return model;
62     }
63
64     public void setModel(ReportModel model) {
65         this.setName(model.getName());
66         this.setNameKey(model.getNameKey());
67         this.setDescription(model.getDescription());
68         this.setDataType(model.getDataType());
69         this.setReportType(model.getReportType());
70         this.setClassName(model.getClassName());
71
72         if(model.getFileData().length > 0) {
73             this.setFileData(model.getFileData());
74         }
75
76         this.setLastModifiedDate(new Timestamp JavaDoc(new Date().getTime()));
77     }
78
79 }
Popular Tags