Consider option to make UUID generated when GenerationType.AUTO is set

Description

To make user's life easier, if the id is of type String and maybe UUID Consider that AUTO leads to the uuid generation.

Environment

None

Activity

Show:
Emmanuel Bernard
March 25, 2015, 3:08 PM

let's close it.

Gunnar Morling
March 25, 2015, 1:57 PM

Hey , in the meantime has been resolved in ORM 5. This automatically maps AUTO to the UUID strategy for properties of type java.util.UUID. So this addresses half of this OGM-724.

Do you still think this also should be done for Strings? Otherwise I think this one can be closed.

Gunnar Morling
January 19, 2015, 4:47 PM

We'll need a more flexible mapping of the AUTO mapping in ORM for that. Currently that's more or less hard-wired (only dependent on the "use new generator mappings" setting), whereas we'd need to make that decision individually for each usage of AUTO, depending on the id property type, and possibly on any @Type value given, allowing the following map to IDENTITY and thus object ids for MongoDB:

So we'd need a (pluggable) contract which returns the strategy to map AUTO to, taking id property type and optionally @Type as an input. And OGM would have to override the default implementation.

Out of Date

Assignee

Unassigned

Reporter

Emmanuel Bernard