Methods Summary |
---|
public void | configure(org.hibernate.type.Type type, java.util.Properties params, org.hibernate.dialect.Dialect d)
uniqueKeyPropertyName = params.getProperty( "key" );
|
private static java.lang.String | determineNameOfPropertyToUse(PostInsertIdentityPersister persister, java.lang.String supplied)
if ( supplied != null ) {
return supplied;
}
int[] naturalIdPropertyIndices = persister.getNaturalIdentifierProperties();
if ( naturalIdPropertyIndices == null ){
throw new IdentifierGenerationException(
"no natural-id property defined; need to specify [key] in " +
"generator parameters"
);
}
if ( naturalIdPropertyIndices.length > 1 ) {
throw new IdentifierGenerationException(
"select generator does not currently support composite " +
"natural-id properties; need to specify [key] in generator parameters"
);
}
ValueInclusion inclusion = persister.getPropertyInsertGenerationInclusions() [ naturalIdPropertyIndices[0] ];
if ( inclusion != ValueInclusion.NONE ) {
throw new IdentifierGenerationException(
"natural-id also defined as insert-generated; need to specify [key] " +
"in generator parameters"
);
}
return persister.getPropertyNames() [ naturalIdPropertyIndices[0] ];
|
public org.hibernate.id.insert.InsertGeneratedIdentifierDelegate | getInsertGeneratedIdentifierDelegate(PostInsertIdentityPersister persister, org.hibernate.dialect.Dialect dialect, boolean isGetGeneratedKeysEnabled)
return new SelectGeneratorDelegate( persister, dialect, uniqueKeyPropertyName );
|