367 words

Issue #189 - auto-generated uuid fields

JDO FeatureVersion: 2.4.7Priority: NormalStatus: ActiveReplies: 5
#1
2013-04-10 18:24

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)
support
support's picture
Joined on 2010-05-03
User Post #1,491
#2
2013-04-10 18:27

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)
support
support's picture
Joined on 2010-05-03
User Post #1,492
#3
2013-04-10 20:57

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.

spiffy
spiffy's picture
Joined on 2013-03-12
User Post #12
#4
2013-04-10 21:55

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)
support
support's picture
Joined on 2010-05-03
User Post #1,494
#5
2013-04-11 08:34

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.

spiffy
spiffy's picture
Joined on 2013-03-12
User Post #13
#6
2013-04-11 13:35

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)
support
support's picture
Joined on 2010-05-03
User Post #1,495

Post Reply

Please read carefully the posting instructions - before posting to the ObjectDB website.

  • You may have to disable pop up blocking in order to use the toolbar (e.g. in Chrome).
  • Use ctrl + right click to open the browser context menu in the editing area (e.g. for using a browser spell checker).
  • To insert formatted lines (e.g. Java code, stack trace) - select a style in the toolbar and then insert the text in the new created block.
  • Avoid overflow of published source code examples by breaking long lines.
  • You may mark in paragraph code words (e.g. class names) with the code style (can be applied by ctrl + D).
  • Long stack traces (> 50 lines) and complex source examples (> 100 lines) should be posted as attachments.
Attachments:
Maximum file size: 32 MB
Cancel