KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > jspPhoneBook > data > PersonDOI


1
2 /*-----------------------------------------------------------------------------
3  * Enhydra Java Application Server
4  * Copyright 1997-2000 Lutris Technologies, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  * notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in
14  * the documentation and/or other materials provided with the distribution.
15  * 3. All advertising materials mentioning features or use of this software
16  * must display the following acknowledgement:
17  * This product includes Enhydra software developed by Lutris
18  * Technologies, Inc. and its contributors.
19  * 4. Neither the name of Lutris Technologies nor the names of its contributors
20  * may be used to endorse or promote products derived from this software
21  * without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY LUTRIS TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
24  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26  * ARE DISCLAIMED. IN NO EVENT SHALL LUTRIS TECHNOLOGIES OR CONTRIBUTORS BE
27  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33  * POSSIBILITY OF SUCH DAMAGE.
34  *-----------------------------------------------------------------------------
35  * phoneList.data/PersonDOI.java
36  *-----------------------------------------------------------------------------
37  */

38
39 package jspPhoneBook.data;
40
41 import java.io.*;
42 import java.sql.*;
43 import java.math.*;
44 import com.lutris.appserver.server.sql.*;
45 import com.lutris.dods.builder.generator.query.*;
46
47 /**
48  * Interface implemented by PersonDO
49  * Interface could also be implemented by a (hand-written) Business Layer class
50  * which uses PersonDO
51  *
52  * @version $Revision: 1.1 $
53  * @author EnhydraTeam
54  * @since PhoneList
55  */

56 public interface PersonDOI {
57
58     ////////////////////////// data member FirstName
59

60     /**
61      * Get firstName of the person
62      *
63      * @return firstName of the person
64      *
65      * @exception DataObjectException
66      * If the object is not found in the database.
67      */

68     public String JavaDoc getFirstName ()
69     throws DataObjectException;
70     
71
72     /**
73      * Set firstName of the person
74      *
75      * @param firstName of the person
76      *
77      * @exception DataObjectException
78      * If the object is not found in the database.
79      */

80     public void setFirstName ( String JavaDoc firstName )
81     throws DataObjectException;
82
83     ////////////////////////// data member LastName
84

85     /**
86      * Get lastName of the person
87      *
88      * @return lastName of the person
89      *
90      * @exception DataObjectException
91      * If the object is not found in the database.
92      */

93     public String JavaDoc getLastName ()
94     throws DataObjectException;
95     
96
97     /**
98      * Set lastName of the person
99      *
100      * @param lastName of the person
101      *
102      * @exception DataObjectException
103      * If the object is not found in the database.
104      */

105     public void setLastName ( String JavaDoc lastName )
106     throws DataObjectException;
107
108     ////////////////////////// data member PhoneNumber
109

110     /**
111      * Get phoneNumber of the person
112      *
113      * @return phoneNumber of the person
114      *
115      * @exception DataObjectException
116      * If the object is not found in the database.
117      */

118     public String JavaDoc getPhoneNumber ()
119     throws DataObjectException;
120     
121
122     /**
123      * Set phoneNumber of the person
124      *
125      * @param phoneNumber of the person
126      *
127      * @exception DataObjectException
128      * If the object is not found in the database.
129      */

130     public void setPhoneNumber ( String JavaDoc phoneNumber )
131     throws DataObjectException;
132
133     /**
134      * Inserts/Updates the DO into its table.
135      *
136      * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
137      * @exception RefAssertionException thrown by okTo method.
138      * @exception java.sql.SQLException if any SQL errors occur.
139      */

140     public void save()
141     throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException;
142     
143     /**
144      * Inserts/Updates the DO into its table.
145      * The transaction is likely provided by the save() method of another DO
146      * which references this DO.
147      *
148      * @param dbt The transaction object to use for this operation.
149      * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
150      * @exception com.lutris.appserver.server.sql.DBRowUpdateException if a version error occurs.
151      * @exception RefAssertionException thrown by okTo method.
152      * @exception java.sql.SQLException if any SQL errors occur.
153      */

154     public void save(DBTransaction dbt)
155     throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException;
156     
157     /**
158      * Inserts/Updates the DO into its table.
159      *
160      * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
161      * @exception RefAssertionException thrown by okTo method.
162      * @exception java.sql.SQLException if any SQL errors occur.
163      * @deprecated Use save() instead.
164      */

165     public void commit()
166     throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException;
167     
168     /**
169      * Inserts/Updates the DO into its table.
170      * The transaction is likely provided by the commit() method of another DO
171      * which references this DO.
172      *
173      * @param dbt The transaction object to use for this operation.
174      * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
175      * @exception com.lutris.appserver.server.sql.DBRowUpdateException if a version error occurs.
176      * @exception RefAssertionException thrown by okTo method.
177      * @exception java.sql.SQLException if any SQL errors occur.
178      * @deprecated Use save() instead.
179      */

180     public void commit(DBTransaction dbt)
181     throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException;
182     
183     /**
184      * Deletes the DO from its table.
185      *
186      * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
187      * @exception RefAssertionException thrown by okTo method.
188      * @exception java.sql.SQLException if any SQL errors occur.
189      */

190     public void delete()
191     throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException;
192     
193     /**
194      * Deletes the DO from its table.
195      * The transaction is likely provided by the delete() method of another DO
196      * which references this DO.
197      *
198      * @param dbt The transaction object to use for this operation.
199      * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
200      * @exception com.lutris.appserver.server.sql.DBRowUpdateException if a version error occurs.
201      * @exception RefAssertionException thrown by okTo method.
202      * @exception java.sql.SQLException if any SQL errors occur.
203      */

204     public void delete(DBTransaction dbt)
205     throws SQLException, DatabaseManagerException, DataObjectException, RefAssertionException, DBRowUpdateException, QueryException;
206
207 }
208
Popular Tags