KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tapestry > vlib > ejb > impl > PersonBean


1 // Copyright 2004 The Apache Software Foundation
2
//
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
6
//
7
// http://www.apache.org/licenses/LICENSE-2.0
8
//
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
14

15 package org.apache.tapestry.vlib.ejb.impl;
16
17 import java.rmi.RemoteException JavaDoc;
18 import java.sql.Timestamp JavaDoc;
19 import java.util.Map JavaDoc;
20
21 import javax.ejb.CreateException JavaDoc;
22
23 /**
24  * Implementation of the Person entity.
25  *
26  * <p>We're using container managed persistance.
27  *
28  * @see org.apache.tapestry.vlib.ejb.IPerson
29  * @see org.apache.tapestry.vlib.ejb.IPersonHome
30  *
31  * @version $Id: PersonBean.java,v 1.4 2004/02/19 17:38:07 hlship Exp $
32  * @author Howard Lewis Ship
33  *
34  **/

35
36 public abstract class PersonBean extends AbstractEntityBean
37 {
38
39     protected String JavaDoc[] getAttributePropertyNames()
40     {
41         return new String JavaDoc[] {
42             "firstName",
43             "lastName",
44             "email",
45             "password",
46             "lockedOut",
47             "admin",
48             "lastAccess" };
49     }
50
51     public abstract void setPersonId(Integer JavaDoc value);
52     
53     public abstract Integer JavaDoc getPersonId();
54
55     public abstract void setEmail(String JavaDoc value);
56
57     public abstract String JavaDoc getEmail();
58
59     public abstract void setFirstName(String JavaDoc value);
60
61     public abstract String JavaDoc getFirstName();
62
63     public abstract void setLastName(String JavaDoc value);
64
65     public abstract String JavaDoc getLastName();
66
67     public abstract void setPassword(String JavaDoc value);
68
69     public abstract String JavaDoc getPassword();
70
71     public abstract void setLockedOut(boolean value);
72
73     public abstract boolean getLockedOut();
74
75     public abstract void setAdmin(boolean value);
76
77     public abstract boolean getAdmin();
78
79     public abstract void setLastAccess(Timestamp JavaDoc value);
80
81     public abstract Timestamp JavaDoc getLastAccess();
82
83     public Integer JavaDoc ejbCreate(Map JavaDoc attributes) throws CreateException JavaDoc, RemoteException JavaDoc
84     {
85         updateEntityAttributes(attributes);
86         
87         setPersonId(allocateKey());
88         
89         return null;
90     }
91
92     public void ejbPostCreate(Map JavaDoc attributes)
93     {
94         // Do nothing
95
}
96 }
Popular Tags