1

I would like to use EclipseLink as a persistence provider and if possible even use JPA annotations, only. I found the following question here on stackoverflow, which I think contains the wrong answer marked as "answered":

JPA equivalent to Hibernate's @NaturalId

Why is it wrong? Because simply adding a unique constraint to a field/column is NOT what naturalID provides as the main benefit in the hibernate world. "@naturalID" provides very important Level 2 cache capabilities, which I would like to use in the future as well. See more details in the following stackoverflow answer:

What is a natural identifier?

Any suggestions/ideas? From the documentation in EclipseLink I could see anything that looks similar... .

Community
  • 1
  • 1
Peter Branforn
  • 1,679
  • 3
  • 17
  • 29

1 Answers1

0

@cacheindex and it's array equivalent helps you achieve L2 hits even if querying by natural (business) keys and not just @id.

Ed Bighands
  • 159
  • 8