KickJava   Java API By Example, From Geeks To Geeks.

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


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.PermissionModel;
25
26 public abstract class PermissionBean extends GenericBean {
27
28     public abstract int getPermissionType();
29     public abstract void setPermissionType(int value);
30
31     public abstract UserLocal getUser();
32     public abstract void setUser(UserLocal user);
33
34     public abstract ProjectLocal getProject();
35     public abstract void setProject(ProjectLocal project);
36
37     public PermissionModel getModel() {
38         PermissionModel model = new PermissionModel();
39         model.setId(this.getId());
40         model.setPermissionType(this.getPermissionType());
41         model.setUserLogin(this.getUser().getLogin());
42         model.setUserId(this.getUser().getId());
43         model.setProjectId(this.getProject().getId());
44         model.setLastModifiedDate(this.getLastModifiedDate());
45         model.setCreateDate(this.getCreateDate());
46         return model;
47     }
48
49     public void setModel(PermissionModel model) {
50         this.setPermissionType(model.getPermissionType());
51         this.setLastModifiedDate(new Timestamp JavaDoc(new Date().getTime()));
52     }
53
54 }
55
Popular Tags