hibernate主键生成策略

hibernate主键生成策略和各自的具体生成器之间的关系,在org.hibernate.id.IdentifierGeneratorFactory中指定了,  
Java代码  
static {     
   GENERATORS.put("uuid", UUIDHexGenerator.class);     
   GENERATORS.put("hilo", TableHiLoGenerator.class);     
   GENERATORS.put("assigned", Assigned.class);     
   GENERATORS.put("identity", IdentityGenerator.class);     
   GENERATORS.put("select", SelectGenerator.class);     
   GENERATORS.put("sequence", SequenceGenerator.class);     
   GENERATORS.put("seqhilo", SequenceHiLoGenerator.class);     
   GENERATORS.put("increment", IncrementGenerator.class);     
   GENERATORS.put("foreign", ForeignGenerator.class);     
   GENERATORS.put("guid", GUIDGenerator.class);     
   GENERATORS.put("uuid.hex", UUIDHexGenerator.class); //uuid.hex is deprecated     
   GENERATORS.put("sequence-identity", SequenceIdentityGenerator.class);     
}    
 
上面十二种策略,加上native,hibernate一共默认支持十三种生成策略。 

你可能感兴趣的:(java,Hibernate,deprecated)