org.hydrateframework
Class QueryRunner.GetSingleObject
java.lang.Object
org.hydrateframework.QueryRunner.GetSingleObject
- All Implemented Interfaces:
- QueryRunner.Observer
- Enclosing class:
- QueryRunner
public static class QueryRunner.GetSingleObject
- extends java.lang.Object
- implements QueryRunner.Observer
This is a BuildObjects callback interface that retrieves a single object of a particular type
from a query. Use this when running a query that will only return one instance
of a particular object (ie. returns one row, or repeated details of the same
one object on multiple rows)
Method Summary |
boolean |
built(java.lang.Object obj,
boolean isNew)
This method is called each time an object is constructed from a row in the query. |
java.lang.Object |
getObject()
Return the single object that has been created as a result of running
this query. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QueryRunner.GetSingleObject
public QueryRunner.GetSingleObject(java.lang.Class cls)
built
public boolean built(java.lang.Object obj,
boolean isNew)
- Description copied from interface:
QueryRunner.Observer
- This method is called each time an object is constructed from a row in the query.
It will be called up to a maximum of n times per row, where n is the number
of assemblers that were added to the
BuildObjects
class.
- Specified by:
built
in interface QueryRunner.Observer
- Parameters:
obj
- an object that has just been read from a row of data.isNew
- true if the object was already in memory and has just been refreshed or
false if this is the first time this object has been seen by the current ObjectContext
getObject
public java.lang.Object getObject()
- Return the single object that has been created as a result of running
this query.
Copyright © 2000 The Hydrate Project. All Rights Reserved.