KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > xquark > mapper > mapping > TableMetaData


1 /*
2  * This file belongs to the XQuark distribution.
3  * Copyright (C) 2003 Universite de Versailles Saint-Quentin.
4  *
5  * This program is free software; you can redistribute it and/or
6  * modify it under the terms of the GNU Lesser General Public
7  * License as published by the Free Software Foundation; either
8  * version 2.1 of the License, or (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13  * Lesser General Public License for more details.
14  *
15  * You should have received a copy of the GNU Lesser General Public
16  * License along with this program; if not, write to the Free Software
17  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307.
18  * You can also get it at http://www.gnu.org/licenses/lgpl.html
19  *
20  * For more information on this software, see http://www.xquark.org.
21  */

22
23 package org.xquark.mapper.mapping;
24
25 import java.util.Collection JavaDoc;
26
27 import org.xquark.jdbc.typing.ColumnMetaData;
28
29 /**
30  * Table properties gained from the JDBC API.
31  *
32  * Owns a set of metadata objects for table's columns.
33  *
34  */

35 public interface TableMetaData
36 {
37
38
39     
40     /**
41      * Accessor to table name.
42      * @return the table name.
43      */

44     public String JavaDoc getTableName();
45
46     /**
47      * Returns the number of columns in the table.
48      * @return the number of columns in the table.
49      */

50     public int getColumnCount();
51     
52     /**
53      * Accessor to metadata for a particular column by name.
54      * @param cname the relational name of the column.
55      * @return column metadata or null if name does not exist.
56      */

57     public ColumnMetaData getColumnMetaData(String JavaDoc cname);
58
59     /**
60      * Accessor to metadata for all the table's columns.
61      * @return a collection of {@link ColumnMetaData} objects.
62      */

63     public Collection JavaDoc getColumnsMetaData();
64     
65     /**
66      * Accessor to table relational unique constraints.
67      * @return a Collection of Collection of {@link ColumnMetaData} objects.
68      */

69     public Collection JavaDoc getUniqueConstraints();
70     
71     /**
72      * Says if all statements can be shared among the table mappings defined on
73      * this user table.
74      * @return boolean
75      */

76     public boolean areStatementsShareable();
77     
78     /**
79      * Setter for the StatementsNotShareable flag.
80      */

81     public void setStatementsNotShareable();
82
83     /**
84      * Says if this user table has multiple table mappings.
85      * @return boolean
86      */

87     public boolean isShared();
88
89     /**
90      * Setter for the Shared flag.
91      */

92     public void setShared();
93
94 }
95
Popular Tags