The problem is the following. I have an Embeddable class (say, Address) wuth multiple fields. Abother class (say, Employee) has several instance fields of class Address (f.e. homeAddress, workAddress, etc.). Certainly I need to have different column names for Address fields in different instances, like workAddressStreet and homeAddressStreet or something like that.
I can use AttributeOverride annotation on each field but this would be very cumbersome. There is an interface NamingStrategy that can be used to solve this problem. But as per all docs and samples I could find it can only be used globally, on session level. The the meantime the system I work on has no such stretegies and introducing such would probably change a lot in existing schema. Isn’t there a way to apply it only for specific class?
Do you really have to use 2 fields like workAddressStreet and homeAddressStreet?
my suggestion is, just use the addressStreet field and have another field say “addressType” value type = 1 is home, value type = 2 is work.