public class SQL extends Object
| Constructor and Description |
|---|
SQL() |
| Modifier and Type | Method and Description |
|---|---|
static <T,E> ArrayExpr<T,E> |
array(Expression<T,E>... elements)
Creates a new array of elements.
|
static <T,E> ArrayExpr<T,E> |
array(SQLType<T,E> type,
T... elements)
Creates a new array of elements.
|
static <T> BooleanExpr<T,T> |
bool(T value)
Creates a new literal.
|
static <T,E> NumberColumn<T,E> |
buildAiColumn(String name,
SQLType<T,E> type,
boolean allowNull)
Create a new SQL column that can be use for creating a SQL table.
|
static <T,E> BooleanColumn<T,E> |
buildBooleanColumn(String name,
SQLType<T,E> type,
boolean allowNull,
T defValue)
Create a new SQL column that can be use for creating a SQL table.
|
static <T,E> Column<T,E> |
buildColumn(String name,
SQLType<T,E> type,
boolean allowNull,
T defValue)
Create a new SQL column that can be use for creating a SQL table.
|
static <T,E> Column<T,E> |
buildColumn(String name,
Table table,
SQLType<T,E> type,
boolean allowNull,
T defValue)
Create a new SQL column that can be use for creating a SQL table.
|
static <T,E> DateColumn<T,E> |
buildDateColumn(String name,
SQLType<T,E> type,
boolean allowNull,
T defValue)
Create a new SQL column that can be use for creating a SQL table.
|
static BuildForeignKeyStep |
buildForeignKey(Column<?,?>... columns)
Creates a new builder that can be use to create a foreign key.
|
static BuildForeignKeyStep |
buildForeignKey(String name,
Column<?,?>... columns)
Creates a new builder that can be use to create a foreign key.
|
static BuildForeignKeyStep |
buildForeignKey(String name,
Table table,
Column<?,?>... columns)
Creates a new builder that can be use to create a foreign key.
|
static BuildForeignKeyStep |
buildForeignKey(Table table,
Column<?,?>... columns)
Creates a new builder that can be use to create a foreign key.
|
static Index |
buildIndex(Column<?,?>... columns)
Create a new index.
|
static Index |
buildIndex(String name,
Column<?,?>... columns)
Create a new index.
|
static Index |
buildIndex(String name,
Table table,
Column<?,?>... columns)
Create a new index.
|
static Index |
buildIndex(Table table,
Column<?,?>... columns)
Create a new index.
|
static <T,E> NumberColumn<T,E> |
buildNumberColumn(String name,
SQLType<T,E> type,
boolean allowNull,
T defValue)
Create a new SQL column that can be use for creating a SQL table.
|
static BuildSchemaStep |
buildSchema(String name)
Creates a new database schema builder, that can be use to collect all the
data for the new schema.
|
static <T,E> StringColumn<T,E> |
buildStringColumn(String name,
SQLType<T,E> type,
boolean allowNull,
T defValue)
Create a new SQL column that can be use for creating a SQL table.
|
static BuildTableStep |
buildTable(String name)
Creates a new SQL table builder, that can be use to collect all the data
for the new table.
|
static <T,E> SQLType<T,E> |
buildType(Class<T> javaType,
Class<E> javaReadType,
JDBCType jdbcType,
int length,
int precision,
SQLValueParser<T,E> parser,
SQLValueWriter<E,T> writer)
Builds a new SQL type.
|
static <T,E> SQLType<T,E> |
buildType(Class<T> javaType,
Class<E> javaReadType,
JDBCType jdbcType,
int length,
SQLValueParser<T,E> parser,
SQLValueWriter<E,T> writer)
Builds a new SQL type.
|
static <T,E> SQLType<T,E> |
buildType(Class<T> javaType,
Class<E> javaReadType,
JDBCType jdbcType,
SQLValueParser<T,E> parser,
SQLValueWriter<E,T> writer)
Builds a new SQL type.
|
static <T> SQLType<T,T> |
buildType(Class<T> javaType,
JDBCType jdbcType)
Builds a new SQL type.
|
static <T> SQLType<T,T> |
buildType(Class<T> javaType,
JDBCType jdbcType,
int length)
Builds a new SQL type.
|
static <T> SQLType<T,T> |
buildType(Class<T> javaType,
JDBCType jdbcType,
int length,
int precision)
Builds a new SQL type.
|
static Index |
buildUnique(Column<?,?>... columns)
Create a new unique index.
|
static Index |
buildUnique(String name,
Column<?,?>... columns)
Create a new unique index.
|
static Index |
buildUnique(String name,
Table table,
Column<?,?>... columns)
Create a new unique index.
|
static Index |
buildUnique(Table table,
Column<?,?>... columns)
Create a new unique index.
|
static ArithmeticExpr<Integer,Integer> |
count()
Creates a new count all expression.
|
static <T> Expression<T,T> |
custom(T value)
Creates a new literal.
|
static <T,E> Expression<T,E> |
custom(T value,
SQLType<T,E> type)
Creates a new literal.
|
static <T> DateExpr<T,T> |
date(T value)
Creates a new literal.
|
static DeleteStep |
delete(Table... tables)
Creates a new "delete" SQL query.
|
static InsertIntoStep |
insertInto(Table table)
Creates a new "insert" SQL query.
|
static Limit |
limit(int count)
Creates a new limit expression.
|
static Limit |
limit(int offset,
int count)
Creates a new limit expression.
|
static DateExpr<LocalDateTime,Date> |
now()
Gets a date time expresion that represents the current date and time.
|
static <T,E> ArithmeticExpr<T,E> |
number(T value)
Creates a new literal.
|
static <T,E> Expression<T,E> |
param(SQLType<T,E> type)
Creates a new param.
|
static SelectStep |
select(Expression<?,?>... columns)
Creates a new "select" SQL query.
|
static <T> StringExpr<T,T> |
str(T value)
Creates a new literal.
|
static UpdateStep |
update(Table table)
Creates a new "update" SQL query.
|
static BooleanExpr<Boolean,Boolean> |
val(boolean value)
Creates a new literal.
|
static BooleanExpr<Boolean,Boolean> |
val(Boolean value)
Creates a new literal.
|
static ArithmeticExpr<Byte,Byte> |
val(byte value)
Creates a new literal.
|
static ArithmeticExpr<Byte,Byte> |
val(Byte value)
Creates a new literal.
|
static Expression<Character,Character> |
val(char value)
Creates a new literal.
|
static Expression<Character,Character> |
val(Character value)
Creates a new literal.
|
static ArithmeticExpr<Double,Double> |
val(double value)
Creates a new literal.
|
static ArithmeticExpr<Double,Double> |
val(Double value)
Creates a new literal.
|
static ArithmeticExpr<Float,Float> |
val(float value)
Creates a new literal.
|
static ArithmeticExpr<Float,Float> |
val(Float value)
Creates a new literal.
|
static ArithmeticExpr<Integer,Integer> |
val(int value)
Creates a new literal.
|
static ArithmeticExpr<Integer,Integer> |
val(Integer value)
Creates a new literal.
|
static ArithmeticExpr<Long,Long> |
val(long value)
Creates a new literal.
|
static ArithmeticExpr<Long,Long> |
val(Long value)
Creates a new literal.
|
static ArithmeticExpr<Number,Number> |
val(Number value)
Creates a new literal.
|
static ArithmeticExpr<Short,Short> |
val(short value)
Creates a new literal.
|
static ArithmeticExpr<Short,Short> |
val(Short value)
Creates a new literal.
|
static StringExpr<String,String> |
val(String value)
Creates a new literal.
|
public static final <T> SQLType<T,T> buildType(Class<T> javaType, JDBCType jdbcType, int length, int precision)
T - The java type for the new SQL type.javaType - The java class for the new SQL type.jdbcType - The JDBC type for the new SQL type.length - The length for strings and numeric types.precision - The precision for numeric types.public static final <T> SQLType<T,T> buildType(Class<T> javaType, JDBCType jdbcType, int length)
T - The java type for the new SQL type.javaType - The java class for the new SQL type.jdbcType - The JDBC type for the new SQL type.length - The length for strings and numeric types.public static final <T> SQLType<T,T> buildType(Class<T> javaType, JDBCType jdbcType)
T - The java type for the new SQL type.javaType - The java class for the new SQL type.jdbcType - The JDBC type for the new SQL type.public static final <T,E> SQLType<T,E> buildType(Class<T> javaType, Class<E> javaReadType, JDBCType jdbcType, int length, int precision, SQLValueParser<T,E> parser, SQLValueWriter<E,T> writer)
T - The final java type of the expression.E - The ResultSet read java type of the expression.javaType - The java class for the new SQL type.javaReadType - The read java class for the new SQL type.jdbcType - The JDBC type for the new SQL type.length - The length for strings and numeric types.precision - The precision for numeric types.parser - The object that will parse the values from the
database for the new SQL type.writer - The object that will write the values to the database
for the new SQL type.public static final <T,E> SQLType<T,E> buildType(Class<T> javaType, Class<E> javaReadType, JDBCType jdbcType, int length, SQLValueParser<T,E> parser, SQLValueWriter<E,T> writer)
T - The final java type of the expression.E - The ResultSet read java type of the expression.javaType - The java class for the new SQL type.javaReadType - The read java class for the new SQL type.jdbcType - The JDBC type for the new SQL type.length - The length for strings and numeric types.parser - The object that will parse the values from the
database for the new SQL type.writer - The object that will write the values to the database
for the new SQL type.public static final <T,E> SQLType<T,E> buildType(Class<T> javaType, Class<E> javaReadType, JDBCType jdbcType, SQLValueParser<T,E> parser, SQLValueWriter<E,T> writer)
T - The final java type of the expression.E - The ResultSet read java type of the expression.javaType - The java class for the new SQL type.javaReadType - The read java class for the new SQL type.jdbcType - The JDBC type for the new SQL type.parser - The object that will parse the values from the
database for the new SQL type.writer - The object that will write the values to the database
for the new SQL type.public static final BuildSchemaStep buildSchema(String name)
name - The name of the schema.public static final BuildTableStep buildTable(String name)
name - The name of the table.public static final <T,E> Column<T,E> buildColumn(String name, SQLType<T,E> type, boolean allowNull, T defValue)
T - The final java type of the expression.E - The ResultSet read java type of the expression.name - The name for the column.type - The SQL type for the colum.allowNull - If the columns allow null values.defValue - The default value for the column.public static final <T,E> Column<T,E> buildColumn(String name, Table table, SQLType<T,E> type, boolean allowNull, T defValue)
T - The final java type of the expression.E - The ResultSet read java type of the expression.name - The name for the column.table - The table for the column.type - The SQL type for the colum.allowNull - If the columns allow null values.defValue - The default value for the column.public static final <T,E> NumberColumn<T,E> buildAiColumn(String name, SQLType<T,E> type, boolean allowNull)
T - The final java type of the expression.E - The ResultSet read java type of the expression.name - The name for the column.type - The SQL type for the colum.allowNull - If the columns allow null values.public static final <T,E> NumberColumn<T,E> buildNumberColumn(String name, SQLType<T,E> type, boolean allowNull, T defValue)
T - The final java type of the expression.E - The ResultSet read java type of the expression.name - The name for the column.type - The SQL type for the colum.allowNull - If the columns allow null values.defValue - The default value for the column.public static final <T,E> DateColumn<T,E> buildDateColumn(String name, SQLType<T,E> type, boolean allowNull, T defValue)
T - The final java type of the expression.E - The ResultSet read java type of the expression.name - The name for the column.type - The SQL type for the colum.allowNull - If the columns allow null values.defValue - The default value for the column.public static final <T,E> StringColumn<T,E> buildStringColumn(String name, SQLType<T,E> type, boolean allowNull, T defValue)
T - The final java type of the expression.E - The ResultSet read java type of the expression.name - The name for the column.type - The SQL type for the colum.allowNull - If the columns allow null values.defValue - The default value for the column.public static final <T,E> BooleanColumn<T,E> buildBooleanColumn(String name, SQLType<T,E> type, boolean allowNull, T defValue)
T - The final java type of the expression.E - The ResultSet read java type of the expression.name - The name for the column.type - The SQL type for the colum.allowNull - If the columns allow null values.defValue - The default value for the column.public static final Index buildIndex(String name, Table table, Column<?,?>... columns)
name - The name of the index.table - The table that the index belongs to.columns - The columns for the index.public static final Index buildIndex(Table table, Column<?,?>... columns)
table - The table that the index belongs to.columns - The columns for the index.public static final Index buildUnique(String name, Table table, Column<?,?>... columns)
name - The name of the index.table - The table that the index belongs to.columns - The columns for the index.public static final Index buildUnique(Table table, Column<?,?>... columns)
table - The table that the index belongs to.columns - The columns for the index.public static final BuildForeignKeyStep buildForeignKey(String name, Table table, Column<?,?>... columns)
name - The name for the foreign key.table - The table that the fk belongs to.columns - The columns for the foreign key.public static final BuildForeignKeyStep buildForeignKey(Table table, Column<?,?>... columns)
table - The table that the fk belongs to.columns - The columns for the foreign key.public static final Index buildIndex(String name, Column<?,?>... columns)
name - The name of the index.columns - The columns for the index.public static final Index buildIndex(Column<?,?>... columns)
columns - The columns for the index.public static final Index buildUnique(String name, Column<?,?>... columns)
name - The name of the index.columns - The columns for the index.public static final Index buildUnique(Column<?,?>... columns)
columns - The columns for the index.public static final BuildForeignKeyStep buildForeignKey(String name, Column<?,?>... columns)
name - The name for the foreign key.columns - The columns for the foreign key.public static final BuildForeignKeyStep buildForeignKey(Column<?,?>... columns)
columns - The columns for the foreign key.public static final SelectStep select(Expression<?,?>... columns)
columns - The columns for the select.public static final InsertIntoStep insertInto(Table table)
table - The table to insert to.public static final UpdateStep update(Table table)
table - The table to update.public static final DeleteStep delete(Table... tables)
tables - The tables to delete.public static final ArithmeticExpr<Number,Number> val(Number value)
value - The value for the literal.public static final ArithmeticExpr<Byte,Byte> val(byte value)
value - The value for the literal.public static final ArithmeticExpr<Byte,Byte> val(Byte value)
value - The value for the literal.public static final ArithmeticExpr<Short,Short> val(short value)
value - The value for the literal.public static final ArithmeticExpr<Short,Short> val(Short value)
value - The value for the literal.public static final ArithmeticExpr<Integer,Integer> val(int value)
value - The value for the literal.public static final ArithmeticExpr<Integer,Integer> val(Integer value)
value - The value for the literal.public static final ArithmeticExpr<Long,Long> val(long value)
value - The value for the literal.public static final ArithmeticExpr<Long,Long> val(Long value)
value - The value for the literal.public static final ArithmeticExpr<Float,Float> val(float value)
value - The value for the literal.public static final ArithmeticExpr<Float,Float> val(Float value)
value - The value for the literal.public static final ArithmeticExpr<Double,Double> val(double value)
value - The value for the literal.public static final ArithmeticExpr<Double,Double> val(Double value)
value - The value for the literal.public static final StringExpr<String,String> val(String value)
value - The value for the literal.public static final BooleanExpr<Boolean,Boolean> val(Boolean value)
value - The value for the literal.public static final BooleanExpr<Boolean,Boolean> val(boolean value)
value - The value for the literal.public static final Expression<Character,Character> val(char value)
value - The value for the literal.public static final Expression<Character,Character> val(Character value)
value - The value for the literal.public static final <T,E> ArithmeticExpr<T,E> number(T value)
T - The final java type of the expression.E - The ResultSet read java type of the expression.value - The value for the literal.public static final <T> BooleanExpr<T,T> bool(T value)
T - The final java type of the expression.value - The value for the literal.public static final <T> StringExpr<T,T> str(T value)
T - The final java type of the expression.value - The value for the literal.public static final <T> DateExpr<T,T> date(T value)
T - The final java type of the expression.value - The value for the literal.public static final <T> Expression<T,T> custom(T value)
T - The final java type of the expression.value - The value for the literal.public static final <T,E> Expression<T,E> custom(T value, SQLType<T,E> type)
T - The final java type of the expression.E - The ResultSet read java type of the expression.value - The value for the literal.type - The SQL type for the colum.public static final <T,E> Expression<T,E> param(SQLType<T,E> type)
T - The final java type of the expression.E - The ResultSet read java type of the expression.type - The type for the param.public static final ArithmeticExpr<Integer,Integer> count()
public static final <T,E> ArrayExpr<T,E> array(Expression<T,E>... elements)
T - The final java type of the expression.E - The ResultSet read java type of the expression.elements - The elements for the array.public static final <T,E> ArrayExpr<T,E> array(SQLType<T,E> type, T... elements)
T - The final java type of the expression.E - The ResultSet read java type of the expression.type - The type for the param.elements - The elements for the array.public static final Limit limit(int offset, int count)
offset - The offset for the limit expression.count - The count for the limit expression.public static final Limit limit(int count)
count - The count for the limit expression.public static final DateExpr<LocalDateTime,Date> now()
Copyright © 2015–2018 Bridje Framework. All rights reserved.