remove unused method marked for removal

Signed-off-by: Gavin King <gavin@hibernate.org>
This commit is contained in:
Gavin King 2024-08-28 12:23:43 +02:00
parent 5975d02e39
commit 318e4e6c5d
2 changed files with 1 additions and 35 deletions

View File

@ -6,7 +6,6 @@
*/
package org.hibernate.engine.internal;
import org.hibernate.Remove;
import org.hibernate.engine.spi.SharedSessionContractImplementor;
import org.hibernate.internal.CoreMessageLogger;
import org.hibernate.metamodel.mapping.EntityVersionMapping;
@ -86,44 +85,13 @@ public final class Versioning {
}
}
/**
* Create an initial optimistic locking value according the {@link VersionJavaType}
* contract for the version property <em>if required</em> and inject it into the
* snapshot state.
*
* @param fields The current snapshot state
* @param versionProperty The index of the version property
* @param versionMapping The version mapping
* @param session The originating session
* @return True if we injected a new version value into the fields array; false
* otherwise.
*
* @deprecated Use {@link #seedVersion(Object, Object[], EntityPersister, SharedSessionContractImplementor)}
*/
@Deprecated(since = "6.2") @Remove
public static boolean seedVersion(
Object[] fields,
int versionProperty,
EntityVersionMapping versionMapping,
SharedSessionContractImplementor session) {
final Object initialVersion = fields[versionProperty];
if ( isNullInitialVersion( initialVersion ) ) {
fields[versionProperty] = seed( versionMapping, session );
return true;
}
else {
LOG.tracev( "Using initial version: {0}", initialVersion );
return false;
}
}
/**
* Determines if the value of the assigned version property should be considered
* a "null" value, that is, if it is literally {@code null}, or if it is a negative
* integer.
*
* @param initialVersion The value initially assigned to a version property
* @return {@code} if the value shoudl be considered null for this purpose
* @return {@code} if the value should be considered null for this purpose
*/
public static boolean isNullInitialVersion(Object initialVersion) {
return initialVersion == null

View File

@ -10,10 +10,8 @@ import java.sql.PreparedStatement;
import java.sql.SQLException;
import org.hibernate.metamodel.mapping.EntityVersionMapping;
import org.hibernate.metamodel.mapping.JdbcMapping;
import org.hibernate.sql.exec.spi.ExecutionContext;
import org.hibernate.sql.exec.spi.JdbcParameterBindings;
import org.hibernate.type.descriptor.java.VersionJavaType;
/**
* Parameter bind specification used for optimistic lock version seeding (from insert statements).