users@jpa-spec.java.net

[jpa-spec users] Re: [jsr338-experts] Re: mapping conversion

From: <fs5_at_gmx.net>
Date: Wed, 18 Jan 2012 10:18:56 +0000 (GMT)

What use-cases should be supported?

So far, I have only seen the need for an
enumeration-to-code-conversation in real-world-projects.

However, there could be more:

* List of Strings to be converted into a single string with
comma-separated values

* Array of Strings to be converted into a comma-separated-values string

* Array of String to be stored as java.sql.Array (Where to get the
java.sql.Connection from?)

* JAXB2: Marshalling/Unmarshalling a graph of objects into a byte[].
(Where to provide the contextPath for the JAXBContext?)

* Auditing: Replacing a stale java.util.Date value with the current
time.

* Encryption: Use the currently logged-in user's key to encrypt/decrypt
a String (How to obtain the currently logged-in user?)


Some of these use cases raise a question that is probably only easy to
answer for the enumeration-to-code conversation: When will such a
converted field/property be updated in the database?

* Always?
* When the java representation changes?
* When the database representation changes?

What is then the criteria for detecting a change?

Kind regards
Frank