From 9f2beca2265f1bcce3132744992d5208f4cb2315 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Sat, 14 Sep 2024 12:28:32 +0200 Subject: [PATCH] add a comment --- .../processor/annotation/AnnotationMetaEntity.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java b/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java index 7c2203da39..4b2349e69c 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java @@ -2397,6 +2397,12 @@ public class AnnotationMetaEntity extends AnnotationMeta { return resultType.asElement().getSimpleName().toString(); } + /** + * In the {@code @Query} annotation we tolerate missing {@code from} clauses + * to an extent that ORM core does not. For example, we accept {@code select name, age} + * and {@code select id where year(date)>:year} as a legit queries. (It would be easy to + * change ORM core to also accept these queries.) + */ private static String addFromClauseIfNecessary(String hql, @Nullable String entityType) { if ( entityType == null ) { return hql;