KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > ojb > broker > Person


1 /*
2  * ObJectRelationalBridge - Bridging Java Objects and Relational Databases
3  * http://objectbridge.sourceforge.net
4  * Copyright (C) 2000, 2001 Thomas Mahler, et al.
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19  */

20
21
22 /*
23  * Created by: thma
24  * Date: May 6, 2001
25  */

26 package org.apache.ojb.broker;
27
28 import java.util.Collection JavaDoc;
29 import java.io.Serializable JavaDoc;
30
31 public class Person implements Serializable JavaDoc
32 {
33
34     private int id;
35     private String JavaDoc firstname;
36     private String JavaDoc lastname;
37     private Collection JavaDoc projects;
38     private Collection JavaDoc roles;
39
40     public Person()
41     {
42     }
43
44     public Person(int pId, String JavaDoc pFirstname, String JavaDoc pLastname)
45     {
46         id = pId;
47         firstname = pFirstname;
48         lastname = pLastname;
49     }
50
51     public Collection JavaDoc getRoles()
52     {
53         return roles;
54     }
55
56     public void setRoles(Collection JavaDoc roles)
57     {
58         this.roles = roles;
59     }
60
61     public int getId()
62     {
63         return id;
64     }
65
66     public void setId(int id)
67     {
68         this.id = id;
69     }
70
71     public String JavaDoc getFirstname()
72     {
73         return firstname;
74     }
75
76     public void setFirstname(String JavaDoc firstname)
77     {
78         this.firstname = firstname;
79     }
80
81     public String JavaDoc getLastname()
82     {
83         return lastname;
84     }
85
86     public void setLastname(String JavaDoc lastname)
87     {
88         this.lastname = lastname;
89     }
90
91     public Collection JavaDoc getProjects()
92     {
93         return projects;
94     }
95
96     public void setProjects(Collection JavaDoc projects)
97     {
98         this.projects = projects;
99     }
100
101     public String JavaDoc toString()
102     {
103         String JavaDoc result = firstname;
104         return result;
105     }
106
107 }
108
Popular Tags