See: Description
| Interface | Description |
|---|---|
| Database |
Interface for the database abstraction.
|
| DataObjectFactory<D extends DataObject<D>> |
The data object factory knows details about the specifics of how a
DataObject is persisted to the database. |
| ObjectCreator<T> |
An object creator is able to create a new object of type
T
from the current row of a ResultSet. |
| ResultProcessor |
A result processor is similar to an
ObjectCreator but it does not
return created objects but processes results in an arbitrary way. |
| WhereClause |
Interface for a WHERE clause that can be used to specify criteria for
matching
DataObjects. |
| Class | Description |
|---|---|
| AbstractDatabase |
Abstract implementation of a
Database. |
| AndWhereClause |
WhereClause implementation that performs an AND conjunction of an
arbitrary amount of where clauses. |
| CountField |
Convenience
Field implementation that creates a field that returns
the count of all rows. |
| DataObject<D extends DataObject<D>> |
A data object represents a data row from a database table.
|
| Field |
A field stores the name of a database column.
|
| Join |
Models a join between two database tables.
|
| Limit |
A LIMIT clause limits the results that are returned.
|
| MapCreator | |
| MatchAllWhereClause |
TODO
|
| ObjectCreator.IntegerCreator |
Creates a single integer from a result set.
|
| ObjectCreator.StringCreator |
Creates a single
String from a result set. |
| OrderField |
An order field stores the name of the field to order a query result by and
the direction of the sorting.
|
| OrWhereClause |
WhereClause implementation that performs an OR conjunction of an
arbitrary amount of where clauses. |
| PairCreator<L,R> |
Object creator implementation that creates a pair from two other object
creators.
|
| Parameter<T> |
A
Parameter stores a parameter value in its native type and can set
it on a PreparedStatement using correct type information. |
| Parameter.BooleanParameter | |
| Parameter.IntegerParameter | |
| Parameter.LongParameter | |
| Parameter.StringParameter | |
| PooledDataSource |
A data source that uses an internal pool of opened connections.
|
| Query |
Container for SQL queries and their parameters.
|
| URLDataSource |
DataSource implementation that creates connections from a JDBC URL
using DriverManager.getConnection(String). |
| ValueField |
A value field stores its name and its value.
|
| ValueFieldWhereClause |
A WHERE clause that requires a field to match a value.
|
| Enum | Description |
|---|---|
| Join.JoinType |
The type of the join.
|
| OrderField.Order |
Defines the possible sort orders.
|
| Query.Type |
The type of the query.
|
| Exception | Description |
|---|---|
| DatabaseException |
Exception that signals a database error.
|
Helper and abstraction classes for database interaction.
The Database interface defines data
manipulation methods that can be used to perform 95% of all necessary
interaction with the database.
The Database.getSingle(Query, ObjectCreator)
method is used to return a single value or object from the database. This
method delegates the work of actually creating the return value to the given
ObjectCreator instance which uses the first
row that is returned by the given query to create the appropriate object.
The
Database.getMultiple(Query, ObjectCreator)
method is used to return multiple values or objects from the database. Again,
the actual creation process is delegated to the given object creator which
will be used for every row the query returns.
Use the Database.insert(Query) method to
execute a query that will insert one new record into a database. It will
return the first auto-generated ID, or -1 if no ID was
generated.
Finally, the Database.update(Query) method
will let you execute a query that updates values in the database. It will
return the number of changed records.
AbstractDatabase Implementation
This class introduces some helper classes the perform the actual SQL queries
and reduces the cost of writing new database backends to the implementation
of two methods:
getConnection() and
returnConnection() . It also contains a method to create a database from a
DataSource (
AbstractDatabase.fromDataSource(javax.sql.DataSource)
).
Query Class
This class stores an SQL query string and its parameters. It is able to
create a PreparedStatement from the parameters and it can be
persisted easily.
ObjectCreator Class
An object creator is responsible for creating objects from the current row of
a ResultSet. It is used by the helper classes in
AbstractDatabase to allow the user to control
the conversion from a result set to a domain-specific object.
Copyright © 2026. All rights reserved.