abstract class AbstractJoin
extends java.lang.Object
Instances of this class are enclosed within query objects and are used at query prepare time and at query execution time to augment the query with the necessary join semantics.
DynamicJoin
,
ServerJoin
Modifier and Type | Field and Description |
---|---|
private HQLExpression |
hql
HQL where clause snippet used to perform the join
|
protected BufferReference |
inverse
Buffer to which this component should join via a foreign relation.
|
private java.lang.Class<?> |
inverseIface
DMO interface for the inverse (non-local) end of the join
|
private java.util.List<org.hibernate.type.Type> |
parameterTypes
Hibernate types of query substitution parameters (null if none)
|
Constructor and Description |
---|
AbstractJoin(RecordBuffer local,
RecordBuffer inverse)
Constructor which invokes abstract initialization methods in subclass
implementations.
|
Modifier and Type | Method and Description |
---|---|
protected abstract HQLExpression |
generateHQL(RecordBuffer local,
RecordBuffer inverse,
RelationInfo info,
boolean dereference)
Generate the HQL where clause snippet which will be inserted into the
overall HQL statement executed by the enclosing query.
|
(package private) HQLExpression |
getHQL()
Get the HQL where clause snippet used to perform the join.
|
BufferReference |
getInverse()
Return the inverse buffer used with this join, if any.
|
(package private) java.lang.Class<?> |
getInverseInterface()
Get the DMO interface for the inverse (non-local) end of the join.
|
(package private) java.util.List<java.io.Serializable> |
getParameters()
Get the values of DMO instance fields or the DMO instance itself which
will be used as the query substitution parameter(s).
|
(package private) java.util.List<org.hibernate.type.Type> |
getParameterTypes()
Get the type of the query substitution parameters, if any, which was
determined at construction.
|
protected abstract java.util.List<org.hibernate.type.Type> |
getParameterTypes(RelationInfo info,
boolean dereference)
Determine the Hibernate type of the query substitution parameters, if
any.
|
java.util.List<FieldReference> |
getUnresolvedParameters()
Get a list of unresolved field reference parameters for this join.
|
protected abstract boolean |
isServerJoin()
Report whether the join represented by this object takes place at the
database server, or within runtime code.
|
protected void |
raiseJoinError(RecordBuffer left,
RecordBuffer right)
Throw
ErrorConditionException that signals that the specified tables cannot be
joined. |
protected void |
setup(RecordBuffer local,
RecordBuffer inverse,
RelationInfo info,
boolean dereference)
Perform any additional setup necessary for a particular join helper
implementation.
|
private final HQLExpression hql
private final java.lang.Class<?> inverseIface
private final java.util.List<org.hibernate.type.Type> parameterTypes
protected final BufferReference inverse
AbstractJoin(RecordBuffer local, RecordBuffer inverse)
local
- Local record buffer (the refering end of the join).inverse
- Inverse record buffer (the referent end of the join).public BufferReference getInverse()
public java.util.List<FieldReference> getUnresolvedParameters()
protected abstract boolean isServerJoin()
true
if the join happens at the server;
false
if it happens in the runtime.protected abstract HQLExpression generateHQL(RecordBuffer local, RecordBuffer inverse, RelationInfo info, boolean dereference)
local
- Local record buffer (the refering end of the join).inverse
- Inverse record buffer (the referent end of the join).info
- Relation descriptor object.dereference
- true
if the local DMO contains a reference to the
foreign record, which must be dereferenced in the HQL query;
false
if the local DMO is the foreign
record, referenced by the inverse DMO.protected abstract java.util.List<org.hibernate.type.Type> getParameterTypes(RelationInfo info, boolean dereference)
info
- Relation descriptor object.dereference
- true
if the local DMO contains a reference to the
foreign record, which must be dereferenced in the HQL query;
false
if the local DMO is the foreign
record, referenced by the inverse DMO.null
if no query substitution parameters are used for this join.protected void setup(RecordBuffer local, RecordBuffer inverse, RelationInfo info, boolean dereference)
local
- Local record buffer (the refering end of the join).inverse
- Inverse record buffer (the referent end of the join).info
- Relation descriptor object.dereference
- true
if the local DMO contains a reference to the
foreign record, which must be dereferenced in the HQL query;
false
if the local DMO is the foreign
record, referenced by the inverse DMO.protected void raiseJoinError(RecordBuffer left, RecordBuffer right)
ErrorConditionException
that signals that the specified tables cannot be
joined.left
- Record buffer which represents the left table in the join.right
- Record buffer which represents the right table in the join.ErrorConditionException
- Contains text "'Table1 of Table2'. Index fields of table 1 must be fields in table
2.".java.util.List<java.io.Serializable> getParameters()
null
. Subclasses which need a
parameter must override this method.null
.java.lang.Class<?> getInverseInterface()
HQLExpression getHQL()
java.util.List<org.hibernate.type.Type> getParameterTypes()
null
if no query substitution parameters are used for this join.