|
For OGM it would be beneficial if there was an extension point in ORM which allows us to customize how GenerationType.AUTO is mapped. AFAICS, that's currently semi-hard coded in ORM. Depending on whether "new_generator_mappings" is set, either SEQUENCE (true) or "native" (false) will be used.
Now for the MongoDB grid dialect we'd ideally do the following: If the id of an entity is declared as org.bson.typesObjectId or @Type(type = "objectid") String, then map AUTO to IDENTITY (ObjectId is a MongoDB-specific type which resembles an identity column). Otherwise map it to TABLE (or SEQUENCE, which transparently falls back to TABLE).
I.e. this decision would not be a global one anymore, but depend on the specific id type.
|