HHH-4347 default column names/properties on CompositeUserType #11

wants to merge 1 commit into


None yet
3 participants

I've created a small patch to allow a CompositeUserType to define a default column mapping (using @columns and @column annotations), which will be concatenated with the name of the property to give unique names for an entity.

I opted to allow the @column annotations instead of the getPropertyNames(), as it is conceptually the same as using these on the property in the entity containing the type today, and it allows for defining other defaults as well (length, precision, nullable, etc).
This means that when annotations are used, they are handled the same whether they are defined on the property (as today) or defined by default on the CompositeUserType, with the only difference being that in the latter case the name defined on the @column annotation will be prefixed by the name of the property. Also, column names are allowed to be different to the names used in queries, at the implementor's discretion.

The patch is backwards-compatible so if any CompositeUserType does not define any of these annotations then everything works the same as before. Also, any @Columns/@column annotations on a property in an entity will override the default defined.

Frode Carlsen

Adding defaults for mapping column name and properties for a CustomUserType

This comment has been minimized.

Show comment
Hide comment

brmeyer Jan 16, 2013


On hold for 5.0.0


brmeyer commented Jan 16, 2013

On hold for 5.0.0

@sebersole sebersole closed this Oct 29, 2014

dreab8 pushed a commit to dreab8/hibernate-orm that referenced this pull request Apr 27, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment