Class Sql<T>
- java.lang.Object
-
- org.jobrunr.storage.sql.common.db.Sql<T>
-
- Direct Known Subclasses:
BackgroundJobServerTable
,JobStatsView
,JobTable
,MetadataTable
,RecurringJobTable
public class Sql<T> extends java.lang.Object
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
Sql()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
delete(java.lang.String statement)
java.util.stream.Stream<SqlResultSet>
execute(java.lang.String statement)
static <T> Sql<T>
forType(java.lang.Class<T> tClass)
void
insert(java.lang.String statement)
void
insert(T item, java.lang.String statement)
void
insertAll(java.util.List<T> batchCollection, java.lang.String statement)
java.util.stream.Stream<SqlResultSet>
select(java.lang.String statement)
long
selectCount(java.lang.String statement)
boolean
selectExists(java.lang.String statement)
void
update(java.lang.String statement)
void
update(T item, java.lang.String statement)
void
updateAll(java.util.List<T> batchCollection, java.lang.String statement)
Sql<T>
using(java.sql.Connection connection, Dialect dialect, java.lang.String tablePrefix, java.lang.String tableName)
Sql<T>
with(java.lang.String name, java.lang.Enum<?> value)
Sql<T>
with(java.lang.String name, java.lang.Object value)
Sql<T>
with(java.lang.String name, java.util.function.Function<T,java.lang.Object> function)
Sql<T>
withOrderLimitAndOffset(java.lang.String order, int limit, long offset)
Sql<T>
withVersion(java.util.function.Function<T,java.lang.Integer> function)
-
-
-
Method Detail
-
forType
public static <T> Sql<T> forType(java.lang.Class<T> tClass)
-
using
public Sql<T> using(java.sql.Connection connection, Dialect dialect, java.lang.String tablePrefix, java.lang.String tableName)
-
with
public Sql<T> with(java.lang.String name, java.util.function.Function<T,java.lang.Object> function)
-
withOrderLimitAndOffset
public Sql<T> withOrderLimitAndOffset(java.lang.String order, int limit, long offset)
-
select
public java.util.stream.Stream<SqlResultSet> select(java.lang.String statement)
-
execute
public java.util.stream.Stream<SqlResultSet> execute(java.lang.String statement)
-
selectCount
public long selectCount(java.lang.String statement) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
selectExists
public boolean selectExists(java.lang.String statement) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
insert
public void insert(T item, java.lang.String statement) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
insert
public void insert(java.lang.String statement) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
update
public void update(java.lang.String statement) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
update
public void update(T item, java.lang.String statement) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
delete
public int delete(java.lang.String statement) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
insertAll
public void insertAll(java.util.List<T> batchCollection, java.lang.String statement) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
updateAll
public void updateAll(java.util.List<T> batchCollection, java.lang.String statement) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
-