tags:

views:

25

answers:

1

Hi all, As I am using using mysql database and I am using id strategy.

@GeneratedValue(strategy = GenerationType.TABLE

and I found that using jpa xml can define a application level generator from the below link

http://www.redhat.com/docs/manuals/jboss/jboss-eap-4.2/doc/hibernate/Annotations%5FReference%5FGuide/Overriding%5Fmetadata%5Fthrough%5FXML.html

I have tried but failed. Did anyone use this method?

A: 

DataNucleus docs define exactly what the JPA spec also defines for XML metadata, as per http://www.datanucleus.org/products/accessplatform%5F2%5F0/jpa/metadata%5Fxml.html and you can define a value generator for a field/property. When done like that it works (with DataNucleus). You don't mention what JPA impl you're using

DataNucleus