com.objectwave.persist.broker
Class HypersonicBroker
java.lang.Object
|
+--com.objectwave.persist.AbstractBroker
|
+--com.objectwave.persist.broker.RDBBroker
|
+--com.objectwave.persist.broker.HypersonicBroker
- All Implemented Interfaces:
- Broker
- public class HypersonicBroker
- extends RDBBroker
HypersonicBroker - works with Hypersonic database http://hsql.oron.ch/
The following two SQL statements must be run to generate primary keys.
CREATE TABLE sequence(nextval INTEGER PRIMARY KEY)
INSERT INTO sequence(nextval) VALUES (1000)
- Version:
- $Id: HypersonicBroker.java,v 2.4 2002/03/23 13:42:10 dave_hoag Exp $
- Author:
- Chi Son
Fields inherited from class com.objectwave.persist.broker.RDBBroker |
broker, brokerPropertySource, connectionPerThread, connectionPool, pool, resultEngine, saveObjectsStrategy, sqlModifyEngine, sqlQueryEngine, statementFactory, threadLocal |
Methods inherited from class com.objectwave.persist.broker.RDBBroker |
beginTransaction, checkObjectPool, cleanupSelect, close, commit, constrainWhereClause, count, createAttributeSelect, customizeDetail, defineSelectList, delete, deleteAll, deleteObjects, deleteObjects, determinePrimaryKey, dumpSQLException, find, findAttributes, findColumnSqlTypes, findResults, findUnique, finishBuildingQuery, generateInsertValues, getBrokerPropertySource, getConnection, getDefaultPrimaryKeyStrategy, getObjectPool, getRDBAdapter, initConfiguration, initialize, initializeConnections, initializeConnections, initializeObjectPooling, insert, main, newRDBConnection, removeObjectPooling, rollback, save, saveObjects, setBrokerPropertySource, setDriver, setObjectPool, setUsingObjectPool, update, update |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HypersonicBroker
public HypersonicBroker()
getDefaultBroker
public static RDBBroker getDefaultBroker()
- Most systems will have only one database broker. This method is used to
support systems of that type.
- Returns:
- The DefaultBroker value
getDefaultDriverName
protected java.lang.String getDefaultDriverName()
- Get the fully qualified class name of the preferred database driver.
- Overrides:
getDefaultDriverName
in class RDBBroker
- Returns:
- java.lang.String
defaultBroker
public RDBBroker defaultBroker()
- Implemented as an instance method to support method overriding.
- Overrides:
defaultBroker
in class RDBBroker
- Returns:
- com.objectwave.persist.RDBBroker or a subclass.
- See Also:
BrokerFactory
nextPrimaryKey
protected java.lang.Object nextPrimaryKey(RDBPersistence pObj)
throws java.sql.SQLException,
QueryException
- Description copied from class:
RDBBroker
- Do a query to determine the next primary key. This is a VERY unsafe
solution and should only be used on databases that don't support other ways
of determining pkey.
- Overrides:
nextPrimaryKey
in class RDBBroker
- Parameters:
pObj
-
- Returns:
- Next available primary key field.
- Throws:
java.sql.SQLException
- Description of Exception
QueryException
- Description of Exception
nextPrimaryKeys
protected int[] nextPrimaryKeys(int count)
throws java.sql.SQLException,
QueryException
- Gets a bunch of primary keys and updates the primary key table at set
intervals
- Parameters:
count
- Description of Parameter
- Returns:
- Next set of primary keys as an array of int
- Throws:
java.sql.SQLException
- Description of Exception
QueryException
- Description of Exception
convertException
protected QueryException convertException(java.sql.SQLException ex,
java.lang.String additionalInfo)
- Description copied from class:
AbstractBroker
- This will ALWAYS return an exception. This allows an Exception converter to
be installed into the broker. This converter can change exception to
specific exception types based upon database error codes. This would,
obviously, be database specific and hence why it is not part of RDBBroker.
- Overrides:
convertException
in class AbstractBroker
- Parameters:
ex
- Description of ParameteradditionalInfo
- Description of Parameter
- Returns:
- Description of the Returned Value