persistence icon indicating copy to clipboard operation
persistence copied to clipboard

Proposal - Standardize @Subslect

Open nexus061 opened this issue 1 month ago • 1 comments

Good morning everyone, It would be interesting to standardize the behavior of Hibernate's @Subselect annotation. I was thinking of doing this through a dedicated annotation of this type:

@Documented @Retention(RUNTIME) @Target(ElementType.TYPE) public @interface VirtualEntity { String query(); boolean nativeQuery() default false; }

The idea is to specify a JPQL query as the default behavior, with the option to force it to a native query when necessary. What do you think?

nexus061 avatar Jan 26 '25 12:01 nexus061