mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-03-07 10:19:36 +00:00
fix two warnings
This commit is contained in:
parent
87df79a3c4
commit
158771bbfa
@ -2234,11 +2234,8 @@ private void addQueryMethod(
|
||||
}
|
||||
|
||||
final AnnotationValue value = getAnnotationValue( mirror, "value" );
|
||||
if ( value != null ) {
|
||||
final Object queryString = value.getValue();
|
||||
if ( queryString instanceof String ) {
|
||||
addQueryMethod(method, returnType, containerTypeName, mirror, isNative, value, (String) queryString);
|
||||
}
|
||||
if ( value != null && value.getValue() instanceof String queryString ) {
|
||||
addQueryMethod( method, returnType, containerTypeName, mirror, isNative, value, queryString );
|
||||
}
|
||||
}
|
||||
|
||||
@ -2388,8 +2385,7 @@ else if ( isInsertUpdateDelete(hql) ) {
|
||||
else {
|
||||
final HqlLexer hqlLexer = HqlParseTreeBuilder.INSTANCE.buildHqlLexer( hql );
|
||||
final List<? extends Token> allTokens = hqlLexer.getAllTokens();
|
||||
for (int i = 0; i < allTokens.size(); i++) {
|
||||
final Token token = allTokens.get(i);
|
||||
for ( final Token token : allTokens ) {
|
||||
switch ( token.getType() ) {
|
||||
case FROM:
|
||||
return hql;
|
||||
@ -2449,8 +2445,8 @@ private void validateHql(
|
||||
context.getEntityNameMappings(), context.getEnumTypesByValue(), context.isIndexing() )
|
||||
);
|
||||
if ( statement != null ) {
|
||||
if ( statement instanceof SqmSelectStatement ) {
|
||||
validateSelectHql( method, returnType, mirror, value, (SqmSelectStatement<?>) statement );
|
||||
if ( statement instanceof SqmSelectStatement<?> selectStatement ) {
|
||||
validateSelectHql( method, returnType, mirror, value, selectStatement );
|
||||
}
|
||||
else {
|
||||
validateUpdateHql( method, returnType, mirror, value );
|
||||
|
Loading…
x
Reference in New Issue
Block a user