Skip to content

Commit 9f2beca

Browse files
committed
add a comment
1 parent 19d5895 commit 9f2beca

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,6 +2397,12 @@ private static String entityName(DeclaredType resultType, AnnotationMirror annot
23972397
return resultType.asElement().getSimpleName().toString();
23982398
}
23992399

2400+
/**
2401+
* In the {@code @Query} annotation we tolerate missing {@code from} clauses
2402+
* to an extent that ORM core does not. For example, we accept {@code select name, age}
2403+
* and {@code select id where year(date)>:year} as a legit queries. (It would be easy to
2404+
* change ORM core to also accept these queries.)
2405+
*/
24002406
private static String addFromClauseIfNecessary(String hql, @Nullable String entityType) {
24012407
if ( entityType == null ) {
24022408
return hql;

0 commit comments

Comments
 (0)