jakartaee / jakartaee/persistence
Standardize @Subslect
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 268
- Forks
- 78
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 13
Description
Good morning everyone,
It would be interesting to standardize the behavior of Hibernate's [@Subselect](https://docs.jboss.org/hibernate/orm/6.6/javadocs/org/hibernate/annotations/Subselect.html) 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?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No repository files or tests are named. Start by reading the Jakarta Persistence annotation and specification material, then compare the linked Hibernate @Subselect behavior with the proposed @VirtualEntity query and nativeQuery options. Done would require an agreed scope and standardized semantics before implementation and tests can be defined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100