I mean that if depending on the property stored you want to use String or long based storage, then the following makes the most sense
@Entity class Foo {
@DateFormat(format=ISO8601) @Temporal(TIMESTAMP) public Date bar;
}
@Type(impl=org.h.o.t.FlexibleDateType)
@inferface DateFormat {
@OverridesAttribute(...)
String format();
}
If you want all Dates properties of a given entity / application to be stored the same, an option makes more sense. At any rate the conversion of type is the responsibility of the type system and not the dialect.
|