mirror of
https://github.com/hibernate/hibernate-orm
synced 2025-02-16 08:05:05 +00:00
HHH-15900 Make SelectGenerator not extend IdentityGenerator
This commit is contained in:
parent
86ba5144f6
commit
8285eba3ac
@ -8,14 +8,16 @@
|
||||
|
||||
import java.util.Properties;
|
||||
|
||||
import org.hibernate.dialect.Dialect;
|
||||
import org.hibernate.generator.InDatabaseGenerator;
|
||||
import org.hibernate.id.factory.spi.StandardGenerator;
|
||||
import org.hibernate.persister.entity.EntityPersister;
|
||||
import org.hibernate.service.ServiceRegistry;
|
||||
import org.hibernate.type.Type;
|
||||
|
||||
/**
|
||||
* A generator that {@code select}s the just-{@code insert}ed row to determine the
|
||||
* {@code IDENTITY} column value assigned by the database. The correct row is located
|
||||
* column value assigned by the database. The correct row is located
|
||||
* using a unique key of the entity, either:
|
||||
* <ul>
|
||||
* <li>the mapped {@linkplain org.hibernate.annotations.NaturalId} of the entity, or
|
||||
@ -32,7 +34,8 @@
|
||||
*
|
||||
* @author Gavin King
|
||||
*/
|
||||
public class SelectGenerator extends IdentityGenerator {
|
||||
public class SelectGenerator
|
||||
implements PostInsertIdentifierGenerator, BulkInsertionCapableIdentifierGenerator, StandardGenerator {
|
||||
private String uniqueKeyPropertyName;
|
||||
|
||||
@Override
|
||||
@ -66,4 +69,14 @@ public String getUniqueKeyPropertyName(EntityPersister persister) {
|
||||
}
|
||||
return persister.getPropertyNames()[naturalIdPropertyIndices[0]];
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean referenceColumnsInSql(Dialect dialect) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getReferencedColumnValues(Dialect dialect) {
|
||||
return new String[0];
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user