Home » Support » Issue Tracking » auto-generated uuid fields

auto-generated uuid fields

Type: Feature requestVersion: 2.4.7Priority: NormalStatus: ActiveReplies: 5
#1

Hello, we're porting a JDO application to ObjectDB which uses uuid-hex generated values. However the page on generated values in your JPA tutorial only mentions numeric generated values, and when we try to use it the error message seems to imply that auto-generating strings isn't supported.

Could you confirm whether this is the case? If so it seems an odd omission, given that it's part of both the JPA and JDO standards (JPA Generator.UUID_HEX and JDO value-strategy="uuid-hex") and that the Java language itself supports it (java.util.UUID).

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#2

Are you sure that this is part of JPA and not an extension of specific products?

See the following links:

http://www.thebinaryidiot.com/archives/2011/06/25/jpa-and-uuid-primary-keys/

http://java.dzone.com/articles/jpa-implementation-patterns-6

They indicate that UUID is set by the application.

Consider following a similar technique as a workaround.

If you provide references that show that JPA should support it as a generated value, then implementing this feature will get high priority.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#3

My mistake - I was looking at Apache OpenJPA and Generator.UUID_HEX isn't listed as an extension, but it turns out EclipseLink doesn't have it so I guess it is only an extension of OpenJPA.

However we are using JDO and it has been in the JDO standard since 2.1.

Generating a UUID at construction time is an obvious workaround, but we will have to check that nothing depends on the ID being null until the object graph is persisted.

#4

Demand for JDO features by current ObjectDB users is low, since almost all the new projects that use ObjectDB are based on JPA.

If and when UUID is added to JPA, it may be implemented in ObjectDB for both JPA and JDO.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)
#5

I understand that you have to follow the market.

But as my team uses JDO it would be helpful if you would at least document explicity which features of the JDO standard you don't support. At the minimum, your documentation page at http://www.objectdb.com/api/java/jdo/annotations/IdGeneratorStrategy which lists the UUIDHEX and UUIDSTRING strategies could include a brief comment to say that you don't support them.

#6

A comment was added to that documentation pagejavax.jdo.annotations.IdGeneratorStrategyJDO enumEnumeration of the id generator strategy values.See JavaDoc Reference Page....

The issue tracking system enables listing all the unsupported JDO features (this issue was added automatically to the list when it was created).

Thank you for your comments. If you find additional issues in supporting JDO please file issues using the "JDO Feature" category.

ObjectDB Support
ObjectDB - Fast Object Database for Java (JPA/JDO)

Post Reply

To post a reply and/or subscribe to update notifications - please login