lsp4jakarta icon indicating copy to clipboard operation
lsp4jakarta copied to clipboard

JEE11_Data: Custom entity-defining annotations must be marked with @EntityDefining

Open archana-1924 opened this issue 1 month ago • 0 comments

Description:

A Jakarta Data provider might define a custom entity-defining annotation. Custom entity-defining annotations must be marked with @EntityDefining. This allows other Jakarta Data providers and tools to recognize and process entities declared with custom entity-defining annotations.

Examples:

Invalid example

@Retention(RUNTIME) 
@Target(TYPE) 
public @interface DomainEntity { 
} 
 
// Usage 
@DomainEntity 
public class Customer { 
    private Long id; 
    private String name; 
} 

Valid example

import jakarta.data.EntityDefining; 
 
@EntityDefining 
@Retention(RUNTIME) 
@Target(TYPE) 
public @interface DomainEntity { 
}  

//Usage: 
@ DomainEntity 
public class Customer { 
    private String name; 
} 

//DomainEntity is a custom entity‑defining annotation, correctly marked with @EntityDefining. 
//Customer is recognized as an entity by Jakarta Data providers. 

Specification: 

https://jakarta.ee/specifications/data/1.0/jakarta-data-1.0#:~:text=Custom%20entity%2Ddefining%20annotations%20must%20be%20marked%20with%20%40EntityDefining

Type of language feature proposed:

Select all that apply

  • [x] diagnostic
  • [ ] quick-fix
  • [ ] snippet
  • [ ] other, please specify:

archana-1924 avatar Nov 21 '25 04:11 archana-1924