public class SqlObjectBuilder extends Object
| Constructor and Description |
|---|
SqlObjectBuilder() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
attach(Handle handle,
Class<T> sqlObjectType)
Create a a sql object of the specified type bound to this handle.
|
static void |
close(Object sqlObject)
Used to close a sql object which lacks a close() method.
|
static <T> T |
onDemand(IDBI dbi,
Class<T> sqlObjectType)
Create a new sql object which will obtain and release connections from this dbi instance, as it needs to,
and can, respectively.
|
static <T> T |
open(IDBI dbi,
Class<T> sqlObjectType)
Open a handle and attach a new sql object of the specified type to that handle.
|
public static <T> T attach(Handle handle, Class<T> sqlObjectType)
handle - the Handle instance to attach ths sql object tosqlObjectType - the type of sql object to createpublic static void close(Object sqlObject)
sqlObject - the sql object to closepublic static <T> T onDemand(IDBI dbi, Class<T> sqlObjectType)
dbi - the DBI instance to be used for obtaining connections when they are requiredsqlObjectType - an interface with annotations declaring desired behaviorpublic static <T> T open(IDBI dbi, Class<T> sqlObjectType)
IDBI.close(Object)dbi - the dbi to be used for opening the underlying handlesqlObjectType - an interface with annotations declaring desired behaviorCopyright © 2018. All rights reserved.