Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide constants for properties #139

Closed
lukasj opened this issue Dec 3, 2016 · 5 comments · Fixed by #482
Closed

Provide constants for properties #139

lukasj opened this issue Dec 3, 2016 · 5 comments · Fixed by #482

Comments

@lukasj
Copy link
Contributor

lukasj commented Dec 3, 2016

There are a lot of available properties, each one applicable to specific scenarios:

  • Persistence Unit level properties (persistence.xml).
  • Entity Manager level properties (EntityManager#setProperty()).
  • Query hints.

Those properties are scattered trough the spec and it's difficult to find all of them and to know which one applies to which scenario.

A simple yet very handful addition would be a class that groups all the properties and specifies its applicability in its JavaDoc.

Hibernate already does something like this: https://github.com/hibernate/hibernate-orm/blob/0a2a5c622e3eb30724e80bc8661c0ac55ebfb2be/hibernate-core/src/main/java/org/hibernate/cfg/AvailableSettings.java

Affected Versions

[2.1.1]

@lukasj
Copy link
Contributor Author

lukasj commented Dec 3, 2016

@glassfishrobot Commented
Reported by ggam

@lukasj
Copy link
Contributor Author

lukasj commented May 5, 2017

@glassfishrobot Commented
This issue was imported from java.net JIRA JPA_SPEC-139

@lukasj
Copy link
Contributor Author

lukasj commented Aug 31, 2018

@gavinking
Copy link
Contributor

This would be a very good thing to do.

gavinking added a commit to gavinking/persistence that referenced this issue Aug 22, 2023
1. add constructor taking name, and make name immutable
2. clarify rules for vendor subclasses
3. add constant property names
4. improve javadoc

see jakartaee#481, jakartaee#139
gavinking added a commit to gavinking/persistence that referenced this issue Aug 22, 2023
@gavinking
Copy link
Contributor

gavinking commented Aug 22, 2023

#482 adds a list of configuration properties to PersistenceConfiguration.

This addresses at least the first requested item, which is, IMO, the most acute need.

In other work (#383) we've already added typesafe methods for specifying timeouts, cache modes, and the "load" graph.

The only standard hint not covered by all the above, unless I've missed something, is the infamous jakarta.persistence.fetchgraph, which, if it were up to me, I would just deprecate.

gavinking added a commit to gavinking/persistence that referenced this issue Aug 22, 2023
@lukasj lukasj linked a pull request Aug 22, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants