[jpa-spec issues] [JIRA] Commented: (JPA_SPEC-74) Obtaining @Version value
- From: "mkarg (JIRA)" <
- Subject: [jpa-spec issues] [JIRA] Commented: (JPA_SPEC-74) Obtaining @Version value
- Date: Mon, 17 Feb 2014 19:24:49 +0000 (UTC)
- Auto-submitted: auto-generated
mkarg commented on JPA_SPEC-74:
An improvement ontop would be em.isCached(Class<?>, id, version) which
returns true or false, depending on the fact whether the EM has an entity
with that primary key and version in cache.
Justification: To answer conditional HTTP requests it would be great to query
the cache for a particular version. If the cache does not contain that
version, EM shall NOT load from disk, but answer to JAX-RS or Servlet that
this entity is not there.
> Obtaining @Version value
> Key: JPA_SPEC-74
> URL: https://java.net/jira/browse/JPA_SPEC-74
> Project: jpa-spec
> Issue Type: Improvement
> Reporter: mkarg
> I want to suggest that a future release of the JPA API provides a means to
> get the value of an entities version attribute.
> Example: em.getVersion(myEntity);
> Justification: Generic frameworks like JAX-RS or Servlets might have an
> interest in getting the value of the version attribute without "knowing"
> which is "the version attribute" for any particular entity. For example,
> JAX-RS or Servlets want to send a ETag header to a client for _any_ entity,
> but the Servlet does not "know" the class of that entity. Like when class
> name and primary key value are provided by a HTTP request. In that case, a
> solution would be em.getVersion(myEntity) which just should return the
> value of the version.
This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see: http://www.atlassian.com/software/jira