Package org.ktorm.global
Provide a more concise DSL syntax based on a global database instance.
Functions
Name | Summary |
---|---|
Insert the given entity into this sequence and return the affected record number. | |
Check if all the records in the table matches the given predicate. | |
Check if there is any record in the table. Check if there is any record in the table matches the given predicate. | |
Create an EntitySequence from this table. | |
Return the average value of the given column or expression of all the records, null if there are no records. | |
Construct insert expressions in the given closure, then batch execute them and return the effected | |
Construct update expressions in the given closure, then batch execute them and return the effected | |
Return the records count in the table. Return the records count in the table that matches the given predicate. | |
fun BaseTable<*>. Join the right table and return a new QuerySource, translated to | |
Delete the records in the table that matches the given predicate. | |
Delete all the records in the table. | |
Obtain all the entity objects from this table, auto left joining all the reference tables. | |
Obtain a list of entity objects matching the given predicate, auto left joining all the reference tables. | |
Obtain an entity object matching the given predicate, auto left joining all the reference tables. | |
fun BaseTable<*>. Join the right table and return a new QuerySource, translated to | |
Construct an insert expression in the given closure, then execute it and return the effected row count. | |
Construct an insert expression in the given closure, then execute it and return the auto-generated key. | |
Execute the callback function using the current database instance. | |
Return | |
Return | |
Return a new-created Query object, left joining all the reference tables, and selecting all columns of them. | |
fun BaseTable<*>. Join the right table and return a new QuerySource, translated to | |
fun <E : Any, T : BaseTable<E>, C : Comparable<C>> T. Return the max value of the given column or expression of all the records, null if there are no records in the table. | |
fun <E : Any, T : BaseTable<E>, C : Comparable<C>> T. Return the min value of the given column or expression of all the records, null if there are no records in the table. | |
Return Return | |
fun BaseTable<*>. Join the right table and return a new QuerySource, translated to | |
fun BaseTable<*>. fun BaseTable<*>. Create a query object, selecting the specific columns or expressions from this table. | |
fun BaseTable<*>. fun BaseTable<*>. Create a query object, selecting the specific columns or expressions from this table distinctly. | |
Return the sum of the given column or expression of all the records, null if there are no records in the table. | |
Construct an update expression in the given closure, then execute it and return the effected row count. | |
Update properties of the given entity to the database and return the affected record number. | |
fun <T> Obtain a connection from Database.Companion.global and invoke the callback function with it. | |
fun <T> Execute the specific callback function in a transaction of Database.Companion.global and returns its result if the |
Companion Object Properties
Name | Summary |
---|---|
val Database.Companion. The global database instance, Ktorm uses this property to obtain a database when any SQL is executed. |
Companion Object Functions
Name | Summary |
---|---|
fun Database.Companion. Connect to a database by a specific connector function and save the returned database instance fun Database.Companion. Connect to a database using a DataSource and save the returned database instance to Database.Companion.global. fun Database.Companion. Connect to a database using the specific connection arguments and save the returned database instance | |
fun Database.Companion. Connect to a database using a DataSource with the Spring support enabled and save the returned database |