KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > hibernate > persister > entity > Queryable


1 //$Id: Queryable.java,v 1.6 2005/06/19 01:36:21 oneovthafew Exp $
2
package org.hibernate.persister.entity;
3
4 /**
5  * Extends the generic <tt>EntityPersister</tt> contract to add
6  * operations required by the Hibernate Query Language
7  *
8  * @author Gavin King
9  */

10 public interface Queryable extends Loadable, PropertyMapping, Joinable {
11
12     /**
13      * Is this an abstract class?
14      */

15     public boolean isAbstract();
16     /**
17      * Is this class explicit polymorphism only?
18      */

19     public boolean isExplicitPolymorphism();
20     /**
21      * Get the class that this class is mapped as a subclass of -
22      * not necessarily the direct superclass
23      */

24     public String JavaDoc getMappedSuperclass();
25     /**
26      * Get the discriminator value for this particular concrete subclass,
27      * as a string that may be embedded in a select statement
28      */

29     public String JavaDoc getDiscriminatorSQLValue();
30
31     /**
32      * Given a query alias and an identifying suffix, render the intentifier select fragment.
33      */

34     public String JavaDoc identifierSelectFragment(String JavaDoc name, String JavaDoc suffix);
35     /**
36      * Given a query alias and an identifying suffix, render the property select fragment.
37      */

38     public String JavaDoc propertySelectFragment(String JavaDoc alias, String JavaDoc suffix, boolean allProperties);
39
40     /**
41      * Get the names of columns used to persist the identifier
42      */

43     public String JavaDoc[] getIdentifierColumnNames();
44
45     /**
46      * Is the inheritence hierarchy described by this persister contained across
47      * multiple tables?
48      *
49      * @return True if the inheritence hierarchy is spread across multiple tables; false otherwise.
50      */

51     public boolean isMultiTable();
52
53     /**
54      * Get the names of all tables used in the hierarchy (up and down) ordered such
55      * that deletes in the given order would not cause contraint violations.
56      *
57      * @return The ordered array of table names.
58      */

59     public String JavaDoc[] getConstraintOrderedTableNameClosure();
60
61     /**
62      * For each table specified in {@link #getConstraintOrderedTableNameClosure()}, get
63      * the columns that define the key between the various hierarchy classes.
64      * <p/>
65      * The first dimension here corresponds to the table indexes returned in
66      * {@link #getConstraintOrderedTableNameClosure()}.
67      * <p/>
68      * The second dimension should have the same length across all the elements in
69      * the first dimension. If not, that'd be a problem ;)
70      *
71      * @return
72      */

73     public String JavaDoc[][] getContraintOrderedTableKeyColumnClosure();
74
75     /**
76      * Get the name of the temporary table to be used to (potentially) store id values
77      * when performing bulk update/deletes.
78      *
79      * @return The appropriate temporary table name.
80      */

81     public String JavaDoc getTemporaryIdTableName();
82
83     /**
84      * Get the appropriate DDL command for generating the temporary table to
85      * be used to (potentially) store id values when performing bulk update/deletes.
86      *
87      * @return The appropriate temporary table creation command.
88      */

89     public String JavaDoc getTemporaryIdTableDDL();
90
91     /**
92      * Given a property name, determine the number of the table which contains the column
93      * to which this property is mapped.
94      * <p/>
95      * Note that this is <b>not</b> relative to the results from {@link #getConstraintOrderedTableNameClosure()}.
96      * It is relative to the subclass table name closure maintained internal to the persister (yick!).
97      * It is also relative to the indexing used to resolve {@link #getSubclassTableName}...
98      *
99      * @param property The name of the property.
100      * @return The nunber of the table to which the property is mapped.
101      */

102     public int getSubclassPropertyTableNumber(String JavaDoc property);
103
104     /**
105      * Get the name of the table with the given index from the internal
106      * array.
107      *
108      * @param number The index into the internal array.
109      * @return
110      */

111     public String JavaDoc getSubclassTableName(int number);
112 }
113
Popular Tags