|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.xorm.datastore.sql.BaseSQLDriver
Implements the datastore driver interface for a "plain vanilla" generic JDBC driver. The implementation is configured by the drivers.properties file, which maps particular idioms for handling sequences and autoincrement columns to particular JDBC driver classes. This is intended to handle all JDBC drivers that work according to the specification; subclasses should be necessary only for databases that behave in odd or non-standard ways.
Nested Class Summary | |
class |
BaseSQLDriver.PreparedStatements
|
Field Summary | |
protected SQLConnectionInfo |
connectionInfo
|
protected Connection |
currentConnection
|
protected DataSource |
dataSource
|
protected Logger |
logger
|
protected boolean |
readOnly
|
Fields inherited from interface org.xorm.I15d |
I18N |
Constructor Summary | |
BaseSQLDriver()
|
Method Summary | |
void |
begin(boolean readOnly)
|
void |
commit()
|
int |
count(Selector selector)
Returns the size of the results that would be returned by the query. |
void |
create(Row row)
Creates (inserts) a new row in the datastore. |
protected BaseSQLDriver.PreparedStatements |
createPreparedStatements(Table table)
Subclasses should override this if they need to provide custom SQL generation for the prepared statements. |
void |
delete(Row row)
Permanently deletes a single row from the datastore. |
protected BaseSQLDriver.PreparedStatements |
getStatements(Table table)
|
protected boolean |
inTransaction()
|
void |
rollback()
|
Collection |
select(Selector selector,
Set extraRows)
Selects from (queries) the datastore for rows matching the specified query conditions. |
void |
setConnectionInfo(SQLConnectionInfo connectionInfo)
|
void |
setDataSource(DataSource dataSource)
|
protected void |
setObject(PreparedStatement ps,
int pos,
Object value,
String type)
Handles default conversions that should work with most JDBC drivers. |
void |
update(Row row)
Updates a row against the database. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected SQLConnectionInfo connectionInfo
protected Logger logger
protected DataSource dataSource
protected Connection currentConnection
protected boolean readOnly
Constructor Detail |
public BaseSQLDriver()
Method Detail |
public void setConnectionInfo(SQLConnectionInfo connectionInfo)
public void setDataSource(DataSource dataSource)
protected boolean inTransaction()
public void begin(boolean readOnly) throws DriverException
begin
in interface DatastoreDriver
DriverException
public void commit() throws DriverException
commit
in interface DatastoreDriver
DriverException
public void rollback() throws DriverException
rollback
in interface DatastoreDriver
DriverException
protected BaseSQLDriver.PreparedStatements createPreparedStatements(Table table)
protected BaseSQLDriver.PreparedStatements getStatements(Table table)
public void create(Row row) throws DriverException
DatastoreDriver
create
in interface DatastoreDriver
DriverException
public void update(Row row) throws DriverException
update
in interface DatastoreDriver
DriverException
public void delete(Row row) throws DriverException
DatastoreDriver
delete
in interface DatastoreDriver
DriverException
public int count(Selector selector) throws DriverException
DatastoreDriver
count
in interface DatastoreDriver
DriverException
public Collection select(Selector selector, Set extraRows) throws DriverException
DatastoreDriver
select
in interface DatastoreDriver
selector
- the root of the parse tree representing the queryextraRows
- a non-null set to which additional objects read
from the datastore can be added, as advised by fetch group
information and optimization choices.
DriverException
protected void setObject(PreparedStatement ps, int pos, Object value, String type) throws SQLException
SQLException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |