When configuring the MetadataBuilder (via #applyIdGenerationTypeInterpreter) to add an IdGeneratorStrategyInterpreter, the interpreter is only called in case of an annotated entity configuration. If using XML for describing the Hibernate metadata, the interceptor is never called. This seems inconsistent behaviour. Afaik there is no reason why this would only work for annotation based metadata (afterall, it is the same sequence generator that is constructed and used no matter how the metadata is described). In the test case I try to alter the increment size of a Sequence generator using the GenerationTypeInterpreter. The sequence increment size in both the XML as annotated entity is set to 20. The configured GenerationTypeInterpreter will set the increment size to 1. The test case points out that when using an annotated entity, the sequence increases with 1. But the entity configured via XML still increases with 20 (~ the Interpreter never got called) |