Skip to content

Commit

Permalink
HHH-16270 - Support for null Query parameters on Sybase
Browse files Browse the repository at this point in the history
(cherry picked from commit c3ddd86)
  • Loading branch information
sebersole committed Apr 25, 2023
1 parent 31b5902 commit f3cbf2e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Expand Up @@ -196,7 +196,6 @@

import org.jboss.logging.Logger;

import jakarta.persistence.GenerationType;
import jakarta.persistence.TemporalType;

import static java.lang.Math.ceil;
Expand Down
Expand Up @@ -52,7 +52,7 @@
import org.hibernate.type.descriptor.jdbc.BlobJdbcType;
import org.hibernate.type.descriptor.jdbc.ClobJdbcType;
import org.hibernate.type.descriptor.jdbc.JdbcType;
import org.hibernate.type.descriptor.jdbc.ObjectNullAsNullTypeJdbcType;
import org.hibernate.type.descriptor.jdbc.ObjectNullAsBinaryTypeJdbcType;
import org.hibernate.type.descriptor.jdbc.TinyIntAsSmallIntJdbcType;
import org.hibernate.type.descriptor.jdbc.spi.JdbcTypeRegistry;

Expand Down Expand Up @@ -186,12 +186,12 @@ public void contributeTypes(TypeContributions typeContributions, ServiceRegistry
jdbcTypeRegistry.addDescriptor( Types.BLOB, BlobJdbcType.PRIMITIVE_ARRAY_BINDING );

// Sybase requires a custom binder for binding untyped nulls with the NULL type
typeContributions.contributeJdbcType( ObjectNullAsNullTypeJdbcType.INSTANCE );
typeContributions.contributeJdbcType( ObjectNullAsBinaryTypeJdbcType.INSTANCE );

// Until we remove StandardBasicTypes, we have to keep this
typeContributions.contributeType(
new JavaObjectType(
ObjectNullAsNullTypeJdbcType.INSTANCE,
ObjectNullAsBinaryTypeJdbcType.INSTANCE,
typeContributions.getTypeConfiguration()
.getJavaTypeRegistry()
.getDescriptor( Object.class )
Expand Down

0 comments on commit f3cbf2e

Please sign in to comment.