KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > openharmonise > rm > dsi > DataStoreObject


1 /*
2  * The contents of this file are subject to the
3  * Mozilla Public License Version 1.1 (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 http://www.mozilla.org/MPL/
6  *
7  * Software distributed under the License is distributed on an "AS IS"
8  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
9  * See the License for the specific language governing rights and
10  * limitations under the License.
11  *
12  * The Initial Developer of the Original Code is Simulacra Media Ltd.
13  * Portions created by Simulacra Media Ltd are Copyright (C) Simulacra Media Ltd, 2004.
14  *
15  * All Rights Reserved.
16  *
17  * Contributor(s):
18  */

19 package org.openharmonise.rm.dsi;
20
21 import java.util.*;
22
23 import org.openharmonise.commons.dsi.*;
24 import org.openharmonise.commons.dsi.dml.*;
25
26
27 /**
28  * An object whose data is taken from and saved to a relational database.
29  * The <code>DataStoreInterface</code> interface provides methods for
30  * accessing the information required for accessing the data directly
31  * from the database.
32  *
33  *
34  * @author Michael Bell
35  * @version $Revision: 1.1 $
36  *
37  */

38 public interface DataStoreObject {
39     
40     /**
41      * Returns the <code>ColumnRef</code> associated to the specified column
42      * name or XML node or attribute name.
43      *
44      * @param sColumn the column, XML node, or attribute name to
45      * return a column reference for
46      * @param bIsHist the historical flag, <code>true</code> if
47      * the column is in the historical database table, otherwise <code>false</code>
48      * @return ColumnRef The created ColumnRef
49      * @throws DataStoreException if any errors occur
50      */

51     public ColumnRef getInstanceColumnRef(String JavaDoc sColumn, boolean bIsHist)
52                                    throws DataStoreException;
53
54     /**
55      * Returns a <code>JoinConditions</code> which represents the join conditions
56      * between this object and the object attribute represented by the given
57      * <code>String</code>.
58      *
59      * @param sObjectTag <code>true</code> if the returned join condition is
60      * an outer join, otherwise <code>false</code>
61      * @return a <code>JoinConditions</code> which represents the join conditions
62      * between this object and the object attribute represented by the given
63      * <code>String</code>
64      * @throws DataStoreException if any errors occur
65      */

66     public JoinConditions getInstanceJoinConditions(String JavaDoc sObjectTag,
67                                                     boolean bIsOuter)
68                                              throws DataStoreException;
69
70     /**
71      * Returns a <code>List</code> of <code>DataStoreObject</code> objects
72      * which have been populated from the given <code>CachedResultSet</code>.
73      *
74      * @param resultSet the result set containing data to populate objects with
75      * @param select the select statement which produced the result set
76      * @return a <code>List</code> of <code>DataStoreObject</code> objects
77      * which have been populated from the given <code>CachedResultSet</code>
78      */

79     public List processResultSet(CachedResultSet resultSet, SelectStatement select);
80
81     /**
82      * Returns a <code>List</code> of <code>DataStoreObject</code> objects
83      * which have been populated from the given <code>CachedResultSet</code>
84      * and has the specified maximum size.
85      *
86      * @param resultSet the result set containing data to populate objects with
87      * @param select the select statement which produced the result set
88      * @param limit the maximum limit of objects to return in the list
89      * @return a <code>List</code> of <code>DataStoreObject</code> objects
90      * which have been populated from the given <code>CachedResultSet</code>
91      */

92     public List processResultSet(CachedResultSet resultSet, SelectStatement select, int limit);
93     
94     /**
95      * Return the database table name associated with this class
96      */

97     public String JavaDoc getDBTableName();
98
99     /**
100      * Returns the identifier associated with this object in the DB
101      */

102     public int getId();
103
104 }
Popular Tags