Polishing

This commit is contained in:
Juergen Hoeller
2025-06-24 21:58:39 +02:00
parent 4190209ead
commit b6aa6899a8
7 changed files with 30 additions and 37 deletions
@@ -40,9 +40,9 @@ public class HibernateQueryException extends InvalidDataAccessResourceUsageExcep
* Return the HQL query string that was invalid.
*/
@Nullable
@SuppressWarnings("NullAway")
public String getQueryString() {
return ((QueryException) getCause()).getQueryString();
QueryException cause = (QueryException) getCause();
return (cause != null ? cause.getQueryString() : null);
}
}
@@ -120,7 +120,6 @@ public class LocalSessionFactoryBuilder extends Configuration {
private final ResourcePatternResolver resourcePatternResolver;
@Nullable
private TypeFilter[] entityTypeFilters = DEFAULT_ENTITY_TYPE_FILTERS;
@@ -379,11 +378,9 @@ public class LocalSessionFactoryBuilder extends Configuration {
* the current class descriptor contained in the metadata reader.
*/
private boolean matchesEntityTypeFilter(MetadataReader reader, MetadataReaderFactory readerFactory) throws IOException {
if (this.entityTypeFilters != null) {
for (TypeFilter filter : this.entityTypeFilters) {
if (filter.match(reader, readerFactory)) {
return true;
}
for (TypeFilter filter : this.entityTypeFilters) {
if (filter.match(reader, readerFactory)) {
return true;
}
}
return false;