org.exolab.castor.jdo.engine

Class SQLQuery

Implemented Interfaces:
PersistenceQuery

public final class SQLQuery
extends java.lang.Object
implements PersistenceQuery

Version:
$Revision: 6230 $ $Date: 2006-04-11 15:26:07 -0600 (Tue, 11 Apr 2006) $
Authors:
Assaf Arkin
Thomas Yip
Bruce Snyder
Werner Guttmann
Ralf Joachim
Since:
1.0

Constructor Summary

SQLQuery(SQLEngine engine, PersistenceFactory factory, String sql, Class[] types, boolean isCallSql)
Creates an instance of SQLQuery.

Method Summary

boolean
absolute(int row)
Move to an absolute position within a ResultSet.
void
close()
void
execute(Object conn, AccessMode accessMode, boolean scrollable)
Object
fetch(ProposedEntity proposedObject)
Class
getResultType()
Identity
nextIdentity(Identity identity)
void
setParameter(int index, Object value)
int
size()
Uses the underlying db's cursors to move to the last row in the result set, get the row number via getRow(), then move back to where ever the user was positioned in the resultset.

Constructor Details

SQLQuery

(package private)  SQLQuery(SQLEngine engine,
                            PersistenceFactory factory,
                            String sql,
                            Class[] types,
                            boolean isCallSql)
Creates an instance of SQLQuery.
Parameters:
engine - SQLEngine instance
sql - The SQL statement to execute
types - Types of the class used.
isCallSql - true if the SQL is issued as part of a CALL SQL statement.

Method Details

absolute

public boolean absolute(int row)
            throws PersistenceException
Move to an absolute position within a ResultSet. use the jdbc 2.0 method to move to an absolute position in the resultset.
Specified by:
absolute in interface PersistenceQuery
Parameters:
row - The row to move to
Returns:
True if the move was successful.
Throws:
PersistenceException - Indicates a problem in moving to an absolute position.

close

public void close()
Specified by:
close in interface PersistenceQuery

execute

public void execute(Object conn,
                    AccessMode accessMode,
                    boolean scrollable)
            throws PersistenceException
Specified by:
execute in interface PersistenceQuery

fetch

public Object fetch(ProposedEntity proposedObject)
            throws PersistenceException
Specified by:
fetch in interface PersistenceQuery

getResultType

public Class getResultType()
Specified by:
getResultType in interface PersistenceQuery

nextIdentity

public Identity nextIdentity(Identity identity)
            throws PersistenceException
Specified by:
nextIdentity in interface PersistenceQuery

setParameter

public void setParameter(int index,
                         Object value)
            throws ArrayIndexOutOfBoundsException,
                   IllegalArgumentException
Specified by:
setParameter in interface PersistenceQuery

size

public int size()
            throws PersistenceException
Uses the underlying db's cursors to move to the last row in the result set, get the row number via getRow(), then move back to where ever the user was positioned in the resultset.
Specified by:
size in interface PersistenceQuery
Returns:
The size of the current result set.
Throws:
PersistenceException - If the excution of this method failed.

Intalio Inc. (C) 1999-2006. All rights reserved http://www.intalio.com