I have defined a class called Time which stores a time value as a BigInteger. I would like many of my entities to have Time properties, but they should all work the same, the only difference being the name of the column. For instance:
class A { Time startTime; } class B { Time logOnTime; } ...
My problem is, if I implement class Time as an @Embeddable, both entity A and B will get a column called timeValue, which is the column name found my embeddable time. If I try to redefine this name using an @AttributeOverride annotation it looks like this:
class A { @AttributeOverride(name="timeValue", column=@Column(name="startTime", precision=17, scale=3, nullable=false, updatable=false)) private Time startTime; }
The problem with this approach is I have to repeat the precision, scale, and other properties, and I am not too keen on repeating this information in all my entity classes.
Is there some way I can redefine the column name *only*, and still leave it up to the embeddable type to decide the precision, scale, nullability, etc.?
Thanks
Randahl
|