ValueGenerationType in legacy xml mapping

Hi,

I have seen since Hibernate 4.3 there is a new @ValueGenerationType annotation which allows to create custom annotation for Generated Properties.
What I’m not seeing if there is any way to use specify the value generation type in a legacy xml mapping. I only see the “generated” attribute for “property” tags, but this is only when the value is generated in the Database, and I need to generate it in Java.

I’m not sure about the “meta” or “type” tags which are children of the “property” tag in the XML, I’ve tried to use them but they dont seem to work

Is it possible to use this annotation in an xml mapping? If not, any other options or workarounds? (I can’t easily switch to class annotations in this codebase)

Thanks in advance,
Angelo.

As far as I understand, this is only available for the annotation model. You can use a MetadataContributor though to change the boot model and “inject” your custom config/mapping.

1 Like