org.apache.ignite.internal.processors.odbc

## Class SqlListenerUtils

- java.lang.Object
- - org.apache.ignite.internal.processors.odbc.SqlListenerUtils

    public abstract class SqlListenerUtils
    extends Object

Binary reader with marshaling non-primitive and non-embedded objects with JDK marshaller.

### Constructor Summary

Constructors
Constructor and Description
`SqlListenerUtils()`

### Method Summary

All Methods Static Methods Concrete Methods
`static int` `exceptionToSqlErrorCode(Throwable e)`
`static boolean` `isPlainType(Class<?> cls)`
`static @Nullable Object` `readObject(BinaryReaderExImpl reader, boolean binObjAllow)`
`static @Nullable Object` `readObject(BinaryReaderExImpl reader, boolean binObjAllow, boolean keepBinary)`
`static @Nullable Object` `readObject(byte type, BinaryReaderExImpl reader, boolean binObjAllow, boolean keepBinary)`
`static String` `translateSqlWildcardsToRegex(String sqlPtrn)` Converts sql pattern wildcards into java regex wildcards.
`static void` `writeObject(BinaryWriterExImpl writer, @Nullable Object obj, boolean binObjAllow)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SqlListenerUtils

    public SqlListenerUtils()

### Method Detail

#### readObject

    @Nullable
    public static @Nullable Object readObject(BinaryReaderExImpl reader,
                                                        boolean binObjAllow)
                                                 throws BinaryObjectException

Parameters:
  `reader` - Reader.
  `binObjAllow` - Allow to read non plaint objects.
Returns:
  Read object.
Throws:
  `BinaryObjectException` - On error.

#### readObject

    @Nullable
    public static @Nullable Object readObject(BinaryReaderExImpl reader,
                                                        boolean binObjAllow,
                                                        boolean keepBinary)
                                                 throws BinaryObjectException

Parameters:
  `reader` - Reader.
  `binObjAllow` - Allow to read non plaint objects.
  `keepBinary` - Whether to deserialize objects or keep in binary format.
Returns:
  Read object.
Throws:
  `BinaryObjectException` - On error.

#### readObject

    @Nullable
    public static @Nullable Object readObject(byte type,
                                                        BinaryReaderExImpl reader,
                                                        boolean binObjAllow,
                                                        boolean keepBinary)
                                                 throws BinaryObjectException

Parameters:
  `type` - Object type.
  `reader` - Reader.
  `binObjAllow` - Allow to read non plaint objects.
Returns:
  Read object.
Throws:
  `BinaryObjectException` - On error.

#### writeObject

    public static void writeObject(BinaryWriterExImpl writer,
                                   @Nullable
                                   @Nullable Object obj,
                                   boolean binObjAllow)
                            throws BinaryObjectException

Parameters:
  `writer` - Writer.
  `obj` - Object to write.
  `binObjAllow` - Allow to write non plain objects.
Throws:
  `BinaryObjectException` - On error.

#### isPlainType

    public static boolean isPlainType(Class<?> cls)

Parameters:
  `cls` - Class.
Returns:
  `true` is the type is plain (not user's custom class).

#### exceptionToSqlErrorCode

    public static int exceptionToSqlErrorCode(Throwable e)

Parameters:
  `e` - Exception to convert.
Returns:
  IgniteQueryErrorCode.

#### translateSqlWildcardsToRegex

    public static String translateSqlWildcardsToRegex(String sqlPtrn)

Converts sql pattern wildcards into java regex wildcards.

Translates "_" to "." and "%" to ".*" if those are not escaped with "\" ("\_" or "\%").

All other characters are considered normal and will be escaped if necessary.

     Example:
          som_    -->     som.
          so%     -->     so.*
          s[om]e  -->     so\[om\]e
          so\_me  -->     so_me
          some?   -->     some\?
          som\e   -->     som\\e

${current.year} Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Database and Caching Platform | : ver. 2.13.0
Release Date | : April 20 2022