/** * Constructs a new DefaultIdentifierGeneratorFactory. */ public DefaultIdentifierGeneratorFactory() { register( "uuid2", UUIDGenerator.class ); register( "guid", GUIDGenerator.class ); // can be done with UUIDGenerator + strategy register( "uuid", UUIDHexGenerator.class ); // "deprecated" for new use register( "uuid.hex", UUIDHexGenerator.class ); // uuid.hex is deprecated register( "hilo", TableHiLoGenerator.class ); register( "assigned", Assigned.class ); register( "identity", IdentityGenerator.class ); register( "select", SelectGenerator.class ); register( "sequence", SequenceGenerator.class ); register( "seqhilo", SequenceHiLoGenerator.class ); register( "increment", IncrementGenerator.class ); register( "foreign", ForeignGenerator.class ); register( "sequence-identity", SequenceIdentityGenerator.class ); register( "enhanced-sequence", SequenceStyleGenerator.class ); register( "enhanced-table", TableGenerator.class ); }
/** * The class (which implements {@link org.hibernate.id.IdentifierGenerator}) * which acts as this dialects native generation strategy. * <p/> * Comes into play whenever the user specifies the native generator. * * @return The native generator class. */ public Class getNativeIdentifierGeneratorClass() { if ( supportsIdentityColumns() ) { return IdentityGenerator.class; } else if ( supportsSequences() ) { return SequenceGenerator.class; } else { return TableHiLoGenerator.class; } }
@Override public Class getIdentifierGeneratorClass(String strategy) { Class generatorClass = super.getIdentifierGeneratorClass(strategy); if("native".equals(strategy) && generatorClass == SequenceGenerator.class) { generatorClass = super.getIdentifierGeneratorClass("sequence-identity"); } return generatorClass; }
@Override public Class getNativeIdentifierGeneratorClass() { return SequenceGenerator.class; }
public Class getNativeIdentifierGeneratorClass() { return SequenceGenerator.class; }
public static boolean supportsIdGenWithBulkInsertion(IdentifierGenerator generator) { return SequenceGenerator.class.isAssignableFrom( generator.getClass() ) || PostInsertIdentifierGenerator.class.isAssignableFrom( generator.getClass() ); }