HHH-18448 Add cast and notEqualTo methods to JpaExpression and SqmExpression

This commit is contained in:
Andrea Boriero 2024-07-30 16:39:54 +02:00 committed by Steve Ebersole
parent 5dd0aa1e1a
commit dfb268ae2a
5 changed files with 15 additions and 3 deletions

View File

@ -60,5 +60,12 @@ public interface JpaExpression<T> extends JpaSelection<T>, Expression<T> {
@Override
Predicate equalTo(Object value);
@Override
<X> JpaExpression<X> cast(Class<X> type);
@Override
Predicate notEqualTo(Expression<?> value);
@Override
Predicate notEqualTo(Object value);
}

View File

@ -236,7 +236,7 @@ public class FullyQualifiedReflectivePathTerminal
}
@Override
public Expression cast(Class type) {
public SqmExpression cast(Class type) {
return null;
}

View File

@ -131,4 +131,9 @@ public interface SqmExpression<T> extends SqmSelectableNode<T>, JpaExpression<T>
return castAs( nodeBuilder().getTypeConfiguration().getBasicTypeForJavaType( type ) );
}
@Override
Predicate notEqualTo(Expression<?> value);
@Override
Predicate notEqualTo(Object value);
}

View File

@ -175,7 +175,7 @@ public class SqmFieldLiteral<T> implements SqmExpression<T>, SqmExpressible<T>,
}
@Override
public <X> Expression<X> cast(Class<X> type) {
public <X> SqmExpression<X> cast(Class<X> type) {
return null;
}

View File

@ -731,7 +731,7 @@ public class SqmSubQuery<T> extends AbstractSqmSelectQuery<T> implements SqmSele
}
@Override
public <X> Expression<X> cast(Class<X> targetType) {
public <X> SqmExpression<X> cast(Class<X> targetType) {
return nodeBuilder().cast( this, targetType );
}