Correction to the QuerySqmImpl constructor used for criteria queries
Signed-off-by: Jan Schatteman <jschatte@redhat.com>
This commit is contained in:
parent
4f6019d524
commit
9e66c77749
|
@ -199,17 +199,14 @@ public class QuerySqmImpl<R>
|
|||
SharedSessionContractImplementor producer) {
|
||||
super( producer );
|
||||
|
||||
if ( sqmStatement instanceof SqmSelectStatement ) {
|
||||
if ( resultType != null ) {
|
||||
SqmUtil.verifyIsSelectStatement( sqmStatement );
|
||||
visitQueryReturnType(
|
||||
( (SqmSelectStatement<R>) sqmStatement ).getQueryPart(),
|
||||
resultType,
|
||||
producer.getFactory()
|
||||
);
|
||||
}
|
||||
else {
|
||||
assert sqmStatement instanceof SqmDmlStatement;
|
||||
throw new IllegalArgumentException( "Non-select queries cannot be typed" );
|
||||
}
|
||||
|
||||
this.hqlString = CRITERIA_HQL_STRING;
|
||||
this.sqmStatement = sqmStatement;
|
||||
|
|
Loading…
Reference in New Issue