org.hibernate.tuple.ValueGenerator currently only works with temporal values. The idea is to extend that to also work more easily with numeric values. Essentially we'd need to add a #seed method. We can even add a default impl simply calling #next which is what temporal version support does pre-6.0 anyway. This change would allow the ValueGenerator contract to function seamlessly with org.hibernate.type.spi.VersionSupport. This has a few benefits.
- This would allow custom ValueGenerator strategies to be applied for @Version attributes, covering at least temporal and numeric types.
- This would allow unified representation of "generated values" for version attributes as well as "normal" attributes; expect id attributes would still need a separate "id generator" contract.
***This affects legacy uses of things like `DbTimestampValue`*** - we'd need to recognize that as the specified Type name and properly interpret the ValueGenerator to use based on the old semantics. |