Class ResultDesc
- java.lang.Object
-
- com.sun.jdo.spi.persistence.support.sqlstore.sql.ResultDesc
-
public class ResultDesc extends Object
This class is used by the store to materialize objects from a JDBC resultset. Each ResultDesc binds values from the ResultSet to instances of a persistence capable class.
-
-
Constructor Summary
Constructors Constructor Description ResultDesc(ClassDesc config, int aggregateResultType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addField(LocalFieldDesc fieldDesc, ColumnRef columnRef, boolean projection)
Create and add a ResultFieldDesc for the given fieldDesc and columnRef.void
doJoin(ResultDesc foreignResult, ForeignFieldDesc parentField)
Joins foreignResult with this resultDescObject
getResult(PersistenceManager pm, ResultSet resultData)
Materialize data from the result set into objects.void
setParentField(ForeignFieldDesc parentField)
Set the field that is the recipient of the result of this ResultDesc.void
setPrefetching()
-
-
-
Constructor Detail
-
ResultDesc
public ResultDesc(ClassDesc config, int aggregateResultType)
-
-
Method Detail
-
addField
public void addField(LocalFieldDesc fieldDesc, ColumnRef columnRef, boolean projection)
Create and add a ResultFieldDesc for the given fieldDesc and columnRef.- Parameters:
fieldDesc
- - the field descriptor for the field that is the recipient of the result value indicated by the columnRef.columnRef
- - indicates which column in the resultset contains the value.projection
- - indicates whether the column is a projection
-
setPrefetching
public void setPrefetching()
-
setParentField
public void setParentField(ForeignFieldDesc parentField)
Set the field that is the recipient of the result of this ResultDesc.- Parameters:
parentField
- - field descriptor for the recipient field of the value of this ResultDesc.
-
getResult
public Object getResult(PersistenceManager pm, ResultSet resultData) throws SQLException
Materialize data from the result set into objects.- Parameters:
pm
- - the PersistenceManager responsible for instantiating objectsresultData
- - JDBC ResultSet containing the data to be materialized- Returns:
- Collection containing the resulting objects. For aggregate queries, the returned object type is specified by the caller.
- Throws:
SQLException
-
doJoin
public void doJoin(ResultDesc foreignResult, ForeignFieldDesc parentField)
Joins foreignResult with this resultDesc- Parameters:
foreignResult
- the foreign ResultDescparentField
- parentField for the foreind ResultDesc
-
-