public abstract class SQLDialect
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
class |
SQLDialect.SetValueStatement
Holds information about a
set values statement |
| Modifier and Type | Field and Description |
|---|---|
protected @NotNull DataManager |
dataManager
The
DataManager to use for database operations |
| Constructor and Description |
|---|
SQLDialect(@NotNull DataManager dataManager)
Construct a new
SQLDialect with the given DataManager |
| Modifier and Type | Method and Description |
|---|---|
@Nullable java.sql.PreparedStatement |
createColumn(@NotNull java.lang.String table,
@NotNull java.lang.String column)
Create a new column in a table
|
protected abstract @Nullable java.sql.PreparedStatement |
createColumnImpl(@NotNull java.lang.String table,
@NotNull java.lang.String column)
Create a new column in a table
|
@NotNull java.sql.PreparedStatement |
createTable(@NotNull java.lang.String table)
Create a new table in the database with the
target primary key column |
protected abstract @NotNull java.sql.PreparedStatement |
createTableImpl(@NotNull java.lang.String table)
Create a new table in the database with the
target primary key column |
@NotNull java.sql.PreparedStatement |
getTables()
Get the tables in the database
|
@NotNull java.sql.PreparedStatement |
getValue(@NotNull java.lang.String table,
@NotNull java.lang.String target,
@NotNull java.lang.String column)
Get the value of a column in a table with respect to the
target |
protected abstract @NotNull java.sql.PreparedStatement |
getValueImpl(@NotNull java.lang.String table,
@NotNull java.lang.String target,
@NotNull java.lang.String column)
Get the value of a column in a table with respect to the
target |
@NotNull java.sql.PreparedStatement |
getValues(@NotNull java.lang.String table)
Get all the values in a table
|
protected abstract @NotNull java.sql.PreparedStatement |
getValuesImpl(@NotNull java.lang.String table)
Get all the values in a table
|
@NotNull java.sql.PreparedStatement |
removeValue(@NotNull java.lang.String table,
@NotNull java.lang.String target,
@NotNull java.lang.String column)
Remove the value of a column in a table with respect to the
target |
protected abstract @NotNull java.sql.PreparedStatement |
removeValueImpl(@NotNull java.lang.String table,
@NotNull java.lang.String target,
@NotNull java.lang.String column)
Remove the value of a column in a table with respect to the
target |
@NotNull java.sql.PreparedStatement |
setValue(@NotNull java.lang.String table,
@NotNull java.lang.String target,
@NotNull java.lang.String column,
@NotNull java.lang.String value)
Set the value of a column in a table with respect to the
target |
protected abstract @NotNull java.sql.PreparedStatement |
setValueImpl(@NotNull java.lang.String table,
@NotNull java.lang.String target,
@NotNull java.lang.String column,
@NotNull java.lang.String value)
Set the value of a column in a table with respect to the
target |
@NotNull com.google.common.collect.ImmutableSet<SQLDialect.SetValueStatement> |
setValues(@NotNull java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>> data)
Set the values of columns in a table with respect to the
target |
@NotNull java.sql.PreparedStatement |
setValues(@NotNull java.lang.String table,
@NotNull java.lang.String target,
@NotNull java.util.Map<java.lang.String,java.lang.String> data)
Set the values of columns in a table with respect to the
target |
protected abstract @NotNull java.sql.PreparedStatement |
setValuesImpl(@NotNull java.lang.String table,
@NotNull java.lang.String target,
@NotNull java.util.Map<java.lang.String,java.lang.String> data)
Set the values of columns in a table with respect to the
target |
protected @NotNull java.sql.PreparedStatement |
setValuesParameters(@NotNull java.lang.String target,
@NotNull java.util.List<java.lang.String> values,
@NotNull java.lang.StringBuilder insertBuilder,
@NotNull java.lang.StringBuilder valuesBuilder,
@Nullable java.lang.StringBuilder updateBuilder)
Used for
setValueImpl(String, String, String, String) to set the parameters of the PreparedStatement |
@NotNull protected final @NotNull DataManager dataManager
DataManager to use for database operationspublic SQLDialect(@NotNull
@NotNull DataManager dataManager)
SQLDialect with the given DataManagerdataManager - dataManager@NotNull
public @NotNull java.sql.PreparedStatement getTables()
throws java.sql.SQLException
java.sql.SQLException - if a database access error occurs@NotNull
public @NotNull java.sql.PreparedStatement createTable(@NotNull
@NotNull java.lang.String table)
throws java.sql.SQLException
target primary key columntable - the name of the table to createPreparedStatement to create the tablejava.sql.SQLException - if a database access error occurs@Nullable
public @Nullable java.sql.PreparedStatement createColumn(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String column)
throws java.sql.SQLException
table - the name of the tablecolumn - the name of the column to createjava.sql.SQLException - if a database access error occurs@NotNull
public @NotNull java.sql.PreparedStatement getValues(@NotNull
@NotNull java.lang.String table)
throws java.sql.SQLException
table - the name of the tablejava.sql.SQLException - if a database access error occurs@NotNull
public @NotNull java.sql.PreparedStatement getValue(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.lang.String column)
throws java.sql.SQLException
targettable - the name of the tabletarget - the target to get the value fromcolumn - the column to get the value fromjava.sql.SQLException - if a database access error occurs@NotNull
public @NotNull java.sql.PreparedStatement setValue(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.lang.String column,
@NotNull
@NotNull java.lang.String value)
throws java.sql.SQLException
targettable - the name of the tabletarget - the target to set the value tocolumn - the column to set the value tovalue - the value to setjava.sql.SQLException - if a database access error occurs@NotNull
public @NotNull java.sql.PreparedStatement setValues(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.util.Map<java.lang.String,java.lang.String> data)
throws java.sql.SQLException
targettable - the name of the tabletarget - the target to set the values todata - the data to set (column, value)java.sql.SQLException - if a database access error occurs@NotNull public @NotNull com.google.common.collect.ImmutableSet<SQLDialect.SetValueStatement> setValues(@NotNull @NotNull java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.String>>> data)
targetdata - the data to set (table, (target, (column, value)))@NotNull
public @NotNull java.sql.PreparedStatement removeValue(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.lang.String column)
throws java.sql.SQLException
targettable - the name of the tabletarget - the target to remove the value fromcolumn - the column to remove the value fromjava.sql.SQLException - if a database access error occurs@NotNull
protected abstract @NotNull java.sql.PreparedStatement createTableImpl(@NotNull
@NotNull java.lang.String table)
throws java.sql.SQLException
target primary key columntable - the name of the table to createPreparedStatement to create the tablejava.sql.SQLException - if a database access error occurs@Nullable
protected abstract @Nullable java.sql.PreparedStatement createColumnImpl(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String column)
throws java.sql.SQLException
table - the name of the tablecolumn - the name of the column to createjava.sql.SQLException - if a database access error occurs@NotNull
protected abstract @NotNull java.sql.PreparedStatement getValuesImpl(@NotNull
@NotNull java.lang.String table)
throws java.sql.SQLException
table - the name of the tablejava.sql.SQLException - if a database access error occurs@NotNull
protected abstract @NotNull java.sql.PreparedStatement getValueImpl(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.lang.String column)
throws java.sql.SQLException
targettable - the name of the tabletarget - the target to get the value fromcolumn - the column to get the value fromjava.sql.SQLException - if a database access error occurs@NotNull
protected abstract @NotNull java.sql.PreparedStatement setValueImpl(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.lang.String column,
@NotNull
@NotNull java.lang.String value)
throws java.sql.SQLException
targettable - the name of the tabletarget - the target to set the value tocolumn - the column to set the value tovalue - the value to setjava.sql.SQLException - if a database access error occurs@NotNull
protected abstract @NotNull java.sql.PreparedStatement setValuesImpl(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.util.Map<java.lang.String,java.lang.String> data)
throws java.sql.SQLException
targettable - the name of the tabletarget - the target to set the values todata - the data to set (column, value)java.sql.SQLException - if a database access error occurs@NotNull
protected @NotNull java.sql.PreparedStatement setValuesParameters(@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.util.List<java.lang.String> values,
@NotNull
@NotNull java.lang.StringBuilder insertBuilder,
@NotNull
@NotNull java.lang.StringBuilder valuesBuilder,
@Nullable
@Nullable java.lang.StringBuilder updateBuilder)
throws java.sql.SQLException
setValueImpl(String, String, String, String) to set the parameters of the PreparedStatementtarget - the target to set the value tovalues - the values to setinsertBuilder - the insert query buildervaluesBuilder - the values query builderupdateBuilder - the update query builderjava.sql.SQLException - if a database access error occurs@NotNull
protected abstract @NotNull java.sql.PreparedStatement removeValueImpl(@NotNull
@NotNull java.lang.String table,
@NotNull
@NotNull java.lang.String target,
@NotNull
@NotNull java.lang.String column)
throws java.sql.SQLException
targettable - the name of the tabletarget - the target to remove the value fromcolumn - the column to remove the value fromjava.sql.SQLException - if a database access error occurs