Implementation of a function based on a SQL query.
The query contains variable parameters represented by the VARIABLE_PROXY
constants, just like the query strings used in JDBC prepared statements
(the value of this variable is "?").
The return value is the one row in the result set converted to an object.
If the result set has no rows or more than one row,
an IllegalArgumentException is thrown.
Therefore, queries will typically retrieve one column and have a where
clause with a primary key condition.
Example:The query SELECT NAME FROM CUSTOMER WHERE ID=?
will define a function that takes one value (the id) as input and returns
one value (the name of the customer).
The (java) return type and the parameter types must be declared.
Defaults (Object/Object[]) will be used otherwise.
Internally, we are using PreparedStatements. Since these statements can be reused,
they are cached by connection using weak references (so that the function
does not keep the connection alive if nobody else does it).
See Also:java.sql.PreparedStatement See Also:org.mandarax.sql.SQLObjectRelationalMapping author: Jens Dietrich version: 3.4 <7 March 05> since: 1.6
Get the type structure of the object, e.g. the types of terms
that can be used with this constructor.
Warning:Number and types must be consistent with
the query and the column types in the table(s).
an array of classes
Perform the function or predicate using an array of terms as parameters.
the result of the perform operation Parameters: parameter - an array of terms Parameters: session - a session object throws: java.lang.UnsupportedOperationException - throws: java.lang.IllegalArgumentException - thrown if any problem occurs, including connectionproblems, or the result set having one or more than one rows
setCloseConnection
public void setCloseConnection(boolean closeConnection)(Code)
Sets whether to close the connection at the end.
Parameters: closeConnection - a boolean
Set the type structure of the object, e.g. the types of terms
that can be used with this constructor.
Warning:Number and types must be consistent with
the query and the column types in the table(s).
struct an array of classes