From af285657dbc6e24c846ddbd02828232f5b98618c Mon Sep 17 00:00:00 2001 From: Gavin King Date: Fri, 1 Mar 2024 19:04:29 +0100 Subject: [PATCH] add missing static imports to generated source --- .../hibernate/jpamodelgen/annotation/AbstractQueryMethod.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/AbstractQueryMethod.java b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/AbstractQueryMethod.java index fe80232adf..5a39e22f86 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/AbstractQueryMethod.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/AbstractQueryMethod.java @@ -527,6 +527,7 @@ public abstract class AbstractQueryMethod implements MetaAttribute { } else if ( type.startsWith(JD_ORDER) || type.startsWith(JD_PAGE_REQUEST) ) { + annotationMetaEntity.staticImport("org.hibernate.query.SortDirection", "*"); declaration .append("\tfor (var _sort : ") .append(name) @@ -544,6 +545,7 @@ public abstract class AbstractQueryMethod implements MetaAttribute { } else if ( type.startsWith(JD_SORT) && type.endsWith("...") ) { // almost identical + annotationMetaEntity.staticImport("org.hibernate.query.SortDirection", "*"); declaration .append("\tfor (var _sort : ") .append(name) @@ -560,6 +562,7 @@ public abstract class AbstractQueryMethod implements MetaAttribute { .append("\t}\n"); } else if ( type.startsWith(JD_SORT) ) { + annotationMetaEntity.staticImport("org.hibernate.query.SortDirection", "*"); declaration .append("\t_orders.add(") .append(annotationMetaEntity.staticImport(HIB_ORDER, "by"))