1
//$Id: Queryable.java 10825 2006-11-16 19:33:19Z steve.ebersole@jboss.com $
2
package org.hibernate.persister.entity;
5
* Extends the generic <tt>EntityPersister</tt> contract to add
6
* operations required by the Hibernate Query Language
10
public interface Queryable extends Loadable, PropertyMapping, Joinable {
13
* Is this an abstract class?
15
public boolean isAbstract();
17
* Is this class explicit polymorphism only?
19
public boolean isExplicitPolymorphism();
21
* Get the class that this class is mapped as a subclass of -
22
* not necessarily the direct superclass
24
public String getMappedSuperclass();
26
* Get the discriminator value for this particular concrete subclass,
27
* as a string that may be embedded in a select statement
29
public String getDiscriminatorSQLValue();
32
* Given a query alias and an identifying suffix, render the intentifier select fragment.
34
public String identifierSelectFragment(String name, String suffix);
36
* Given a query alias and an identifying suffix, render the property select fragment.
38
public String propertySelectFragment(String alias, String suffix, boolean allProperties);
41
* Get the names of columns used to persist the identifier
43
public String[] getIdentifierColumnNames();
46
* Is the inheritence hierarchy described by this persister contained across
49
* @return True if the inheritence hierarchy is spread across multiple tables; false otherwise.
51
public boolean isMultiTable();
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.
57
* @return The ordered array of table names.
59
public String[] getConstraintOrderedTableNameClosure();
62
* For each table specified in {@link #getConstraintOrderedTableNameClosure()}, get
63
* the columns that define the key between the various hierarchy classes.
65
* The first dimension here corresponds to the table indexes returned in
66
* {@link #getConstraintOrderedTableNameClosure()}.
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 ;)
73
public String[][] getContraintOrderedTableKeyColumnClosure();
76
* Get the name of the temporary table to be used to (potentially) store id values
77
* when performing bulk update/deletes.
79
* @return The appropriate temporary table name.
81
public String getTemporaryIdTableName();
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.
87
* @return The appropriate temporary table creation command.
89
public String getTemporaryIdTableDDL();
92
* Given a property name, determine the number of the table which contains the column
93
* to which this property is mapped.
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}...
99
* @param propertyPath The name of the property.
100
* @return The nunber of the table to which the property is mapped.
102
public int getSubclassPropertyTableNumber(String propertyPath);
105
* Determine whether the given property is declared by our
106
* mapped class, our super class, or one of our subclasses...
108
* Note: the method is called 'subclass property...' simply
109
* for consistency sake (e.g. {@link #getSubclassPropertyTableNumber}
111
* @param propertyPath The property name.
112
* @return The property declarer
114
public Declarer getSubclassPropertyDeclarer(String propertyPath);
117
* Get the name of the table with the given index from the internal
120
* @param number The index into the internal array.
123
public String getSubclassTableName(int number);
126
* Is the version property included in insert statements?
128
public boolean isVersionPropertyInsertable();
131
* The alias used for any filter conditions (mapped where-fragments or
134
* This may or may not be different from the root alias depending upon the
135
* inheritence mapping strategy.
137
* @param rootAlias The root alias
138
* @return The alias used for "filter conditions" within the where clause.
140
public String generateFilterConditionAlias(String rootAlias);
142
public static class Declarer {
143
public static final Declarer CLASS = new Declarer( "class" );
144
public static final Declarer SUBCLASS = new Declarer( "subclass" );
145
public static final Declarer SUPERCLASS = new Declarer( "superclass" );
146
private final String name;
147
public Declarer(String name) {
150
public String toString() {