001: /*-----------------------------------------------------------------------------
002: * Enhydra Java Application Server
003: * Copyright 1997-2000 Lutris Technologies, Inc.
004: * All rights reserved.
005: *
006: * Redistribution and use in source and binary forms, with or without
007: * modification, are permitted provided that the following conditions
008: * are met:
009: * 1. Redistributions of source code must retain the above copyright
010: * notice, this list of conditions and the following disclaimer.
011: * 2. Redistributions in binary form must reproduce the above copyright
012: * notice, this list of conditions and the following disclaimer in
013: * the documentation and/or other materials provided with the distribution.
014: * 3. All advertising materials mentioning features or use of this software
015: * must display the following acknowledgement:
016: * This product includes Enhydra software developed by Lutris
017: * Technologies, Inc. and its contributors.
018: * 4. Neither the name of Lutris Technologies nor the names of its contributors
019: * may be used to endorse or promote products derived from this software
020: * without specific prior written permission.
021: *
022: * THIS SOFTWARE IS PROVIDED BY LUTRIS TECHNOLOGIES AND CONTRIBUTORS ``AS IS''
023: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
024: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
025: * ARE DISCLAIMED. IN NO EVENT SHALL LUTRIS TECHNOLOGIES OR CONTRIBUTORS BE
026: * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
027: * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
028: * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
029: * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
030: * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
031: * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
032: * POSSIBILITY OF SUCH DAMAGE.
033: *-----------------------------------------------------------------------------
034: * phoneList.data/PersonDOI.java
035: *-----------------------------------------------------------------------------
036: */
037:
038: package jspPhoneBook.data;
039:
040: import java.io.*;
041: import java.sql.*;
042: import java.math.*;
043: import com.lutris.appserver.server.sql.*;
044: import com.lutris.dods.builder.generator.query.*;
045:
046: /**
047: * Interface implemented by PersonDO
048: * Interface could also be implemented by a (hand-written) Business Layer class
049: * which uses PersonDO
050: *
051: * @version $Revision: 1.1 $
052: * @author EnhydraTeam
053: * @since PhoneList
054: */
055: public interface PersonDOI {
056:
057: ////////////////////////// data member FirstName
058:
059: /**
060: * Get firstName of the person
061: *
062: * @return firstName of the person
063: *
064: * @exception DataObjectException
065: * If the object is not found in the database.
066: */
067: public String getFirstName() throws DataObjectException;
068:
069: /**
070: * Set firstName of the person
071: *
072: * @param firstName of the person
073: *
074: * @exception DataObjectException
075: * If the object is not found in the database.
076: */
077: public void setFirstName(String firstName)
078: throws DataObjectException;
079:
080: ////////////////////////// data member LastName
081:
082: /**
083: * Get lastName of the person
084: *
085: * @return lastName of the person
086: *
087: * @exception DataObjectException
088: * If the object is not found in the database.
089: */
090: public String getLastName() throws DataObjectException;
091:
092: /**
093: * Set lastName of the person
094: *
095: * @param lastName of the person
096: *
097: * @exception DataObjectException
098: * If the object is not found in the database.
099: */
100: public void setLastName(String lastName) throws DataObjectException;
101:
102: ////////////////////////// data member PhoneNumber
103:
104: /**
105: * Get phoneNumber of the person
106: *
107: * @return phoneNumber of the person
108: *
109: * @exception DataObjectException
110: * If the object is not found in the database.
111: */
112: public String getPhoneNumber() throws DataObjectException;
113:
114: /**
115: * Set phoneNumber of the person
116: *
117: * @param phoneNumber of the person
118: *
119: * @exception DataObjectException
120: * If the object is not found in the database.
121: */
122: public void setPhoneNumber(String phoneNumber)
123: throws DataObjectException;
124:
125: /**
126: * Inserts/Updates the DO into its table.
127: *
128: * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
129: * @exception RefAssertionException thrown by okTo method.
130: * @exception java.sql.SQLException if any SQL errors occur.
131: */
132: public void save() throws SQLException, DatabaseManagerException,
133: DataObjectException, RefAssertionException,
134: DBRowUpdateException, QueryException;
135:
136: /**
137: * Inserts/Updates the DO into its table.
138: * The transaction is likely provided by the save() method of another DO
139: * which references this DO.
140: *
141: * @param dbt The transaction object to use for this operation.
142: * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
143: * @exception com.lutris.appserver.server.sql.DBRowUpdateException if a version error occurs.
144: * @exception RefAssertionException thrown by okTo method.
145: * @exception java.sql.SQLException if any SQL errors occur.
146: */
147: public void save(DBTransaction dbt) throws SQLException,
148: DatabaseManagerException, DataObjectException,
149: RefAssertionException, DBRowUpdateException, QueryException;
150:
151: /**
152: * Inserts/Updates the DO into its table.
153: *
154: * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
155: * @exception RefAssertionException thrown by okTo method.
156: * @exception java.sql.SQLException if any SQL errors occur.
157: * @deprecated Use save() instead.
158: */
159: public void commit() throws SQLException, DatabaseManagerException,
160: DataObjectException, RefAssertionException,
161: DBRowUpdateException, QueryException;
162:
163: /**
164: * Inserts/Updates the DO into its table.
165: * The transaction is likely provided by the commit() method of another DO
166: * which references this DO.
167: *
168: * @param dbt The transaction object to use for this operation.
169: * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
170: * @exception com.lutris.appserver.server.sql.DBRowUpdateException if a version error occurs.
171: * @exception RefAssertionException thrown by okTo method.
172: * @exception java.sql.SQLException if any SQL errors occur.
173: * @deprecated Use save() instead.
174: */
175: public void commit(DBTransaction dbt) throws SQLException,
176: DatabaseManagerException, DataObjectException,
177: RefAssertionException, DBRowUpdateException, QueryException;
178:
179: /**
180: * Deletes the DO from its table.
181: *
182: * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
183: * @exception RefAssertionException thrown by okTo method.
184: * @exception java.sql.SQLException if any SQL errors occur.
185: */
186: public void delete() throws SQLException, DatabaseManagerException,
187: DataObjectException, RefAssertionException,
188: DBRowUpdateException, QueryException;
189:
190: /**
191: * Deletes the DO from its table.
192: * The transaction is likely provided by the delete() method of another DO
193: * which references this DO.
194: *
195: * @param dbt The transaction object to use for this operation.
196: * @exception com.lutris.appserver.server.sql.DatabaseManagerException if a Transaction can not be created.
197: * @exception com.lutris.appserver.server.sql.DBRowUpdateException if a version error occurs.
198: * @exception RefAssertionException thrown by okTo method.
199: * @exception java.sql.SQLException if any SQL errors occur.
200: */
201: public void delete(DBTransaction dbt) throws SQLException,
202: DatabaseManagerException, DataObjectException,
203: RefAssertionException, DBRowUpdateException, QueryException;
204:
205: }
|