The default behavior is to look at the java type of the identifier attribute
- If the identifier type is UUID, Hibernate is going to use an UUID identifier
- If the identifier type is numerical (e.g. Long, Integer), then Hibernate is going to use the IdGeneratorStrategyInterpreter to resolve the identifier generator strategy
- FallbackInterpreter - AUTO always resolves to SequenceStyleGenerator. If the underlying database supports sequences, then a SEQUENCE generator is used. Otherwise, a TABLE generator is going to be used instead.
- LegacyFallbackInterpreter - maps AUTO to the native generator strategy which uses the Dialect#getNativeIdentifierGeneratorStrategy to resolve the actual identifier generator (e.g. identity or sequence).
从 Hibernate 5.0 起, FallbackInterpreter 是默认值。在之前, LegacyFallbackInterpreter 是默认值,但如果设置 hibernate.id.new_generator_mappings=true 则 FallbackInterpreter 是默认值。