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

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

@frode-carlsen

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.

Regards,
Frode Carlsen

frodecarlsen HHH-4347
Adding defaults for mapping column name and properties for a CustomUserType
545c8eb
@brmeyer
Member
brmeyer commented Jan 16, 2013

On hold for 5.0.0

@sebersole sebersole closed this Oct 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment