org.mariadb.jdbc.internal.query

## Class MariaDbQuery

- java.lang.Object
- - org.mariadb.jdbc.internal.query.MariaDbQuery

All Implemented Interfaces:
  Query

    public class MariaDbQuery
    extends Object
    implements Query

### Constructor Summary

Constructors
Constructor and Description
`MariaDbQuery(String query)` Constructor.

### Method Summary

All Methods Instance Methods Concrete Methods
`boolean` `equals(Object otherObj)`
`int` `getQuerySize()`
`String` `toString()`
`void` `validate()`
`void` `writeFirstRewritePart(OutputStream os)`
`void` `writeLastRewritePart(OutputStream os)`
`int` `writeLastRewritePartLength()`
`void` `writeTo(OutputStream os)` Write whole query to buffer.
`void` `writeTo(OutputStream ostream, int offset, int packLength)` Write whole query to buffer.
`void` `writeToRewritablePart(OutputStream os, int rewriteOffset)` Write rewritable part.
`int` `writeToRewritablePartLength(int rewriteOffset)`

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

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

### Constructor Detail

#### MariaDbQuery

    public MariaDbQuery(String query)

Constructor.

Parameters:
  `query` - sql query

### Method Detail

#### writeTo

    public void writeTo(OutputStream os)
                 throws IOException

Write whole query to buffer.

Specified by:
  `writeTo` in interface `Query`
Parameters:
  `os` - outputStream
Throws:
  `IOException` - if any error occur when writing to buffer

#### writeTo

    public void writeTo(OutputStream ostream,
                        int offset,
                        int packLength)
                 throws IOException

Write whole query to buffer.

Parameters:
  `ostream` - outputStream
  `offset` - buffer offset
  `packLength` - max length
Throws:
  `IOException` - if any error occur when writing to buffer

#### writeFirstRewritePart

    public void writeFirstRewritePart(OutputStream os)
                               throws IOException

Specified by:
  `writeFirstRewritePart` in interface `Query`
Throws:
  `IOException`

#### writeLastRewritePart

    public void writeLastRewritePart(OutputStream os)
                              throws IOException

Specified by:
  `writeLastRewritePart` in interface `Query`
Throws:
  `IOException`

#### writeLastRewritePartLength

    public int writeLastRewritePartLength()

Specified by:
  `writeLastRewritePartLength` in interface `Query`

#### writeToRewritablePart

    public void writeToRewritablePart(OutputStream os,
                                      int rewriteOffset)
                               throws IOException

Write rewritable part.

example : "insert into (a,b) into (1,2)" this method will write the ",(1,2)" part.

Specified by:
  `writeToRewritablePart` in interface `Query`
Parameters:
  `os` - outputstream
  `rewriteOffset` - offset
Throws:
  `IOException` - if any error occur when writing to buffer

#### writeToRewritablePartLength

    public int writeToRewritablePartLength(int rewriteOffset)

Specified by:
  `writeToRewritablePartLength` in interface `Query`

#### getQuerySize

    public int getQuerySize()

Specified by:
  `getQuerySize` in interface `Query`

#### equals

    public boolean equals(Object otherObj)

Overrides:
  `equals` in class `Object`

#### validate

    public void validate()
                  throws QueryException

Specified by:
  `validate` in interface `Query`
Throws:
  `QueryException`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`