users@jpa-spec.java.net

[jpa-spec users] Custom ID Generation Strategy and Programmatic Access to Mapping Metadata

From: <ewestfal_at_gmail.com>
Date: Wed, 3 Jul 2013 03:13:54 +0000 (UTC)

Hello, and I apologize in advance if this is the wrong list to use for
such a question, so if that's the case feel free to tell me to bug off
:)

I work on an open source project that is building some framework
functionality on top of JPA. I'm really happy with some of the new
features in JPA 2.1 (converters!), but there are couple things that JPA
is lacking which require us to still drop down to a "vendor-specific"
approach in order to accomplish what we need to for our applications.

I wonder if anyone know whether or not either of these features are
planned to be incorporated into a future version of JPA?

1) Programmatic access to all mapping metadata. I know that much of
this is available via the JPA Metamodel, but there are a number of
things that can't be determined there. Namely, accessing the full set
of information that might be present in orm.xml or annotations (such as
table name, fetch type, column names, etc.).

It's simple to get this information from EclipseLink right now by
casting the JPA metamodel objects to their implementation version and
looking at classes like
org.eclipse.persistence.mappings.CollectionMapping, but one day I would
love to be able to do something like this with a pure JPA approach ;)

2) Custom ID generation. Right now it's possible to do this using
"customizers" in EclipseLink, but it would be great if there was a way
to go beyond the four built-in GenerationTypes. Especially when trying
to map on top of custom approaches to identifier generation (such as a
SPROC).

Thanks in advance to anyone who can provide insight to me on whether or
not I can ever expect to see features like this in a future version of
JPA.

Eric