|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
iBATIS uses an implementation of this interface to create result objects after the execution of a statement. To use, specify your implementation class as the type for the "resultObjectFactory" element in the SqlMapConfig. Any implementation of this interface must have a public no argument constructor.
Method Summary | |
java.lang.Object |
createInstance(java.lang.String statementId,
java.lang.Class clazz)
Returns a new instance of the requested class. |
void |
setProperty(java.lang.String name,
java.lang.String value)
Called for each property configured in the SqlMapCong file. |
Method Detail |
public java.lang.Object createInstance(java.lang.String statementId, java.lang.Class clazz) throws java.lang.InstantiationException, java.lang.IllegalAccessException
java.util.Collection
then iBATIS will suppliy default implementations of the common interfaces
if the factory chooses not to create the object. If the
embedded object is a java.util.List
or
java.util.Collection
the default behavior is to
create an java.util.ArrayList
. If the embedded object is a
java.util.Set
the default behavior
is to create a java.util.HashSet
.null
from this method, iBATIS will attempt
to create in instance of the class with it's normal mechanism. This means
that you can selectively choose which objects to create with this interface.
In the event that you choose not to create an object, iBATIS will translate some
common interfaces to their common implementations. If the requested
class is List or Collection iBATIS will create an ArrayList. If the requested
class is Set then iBATIS will create a HashSet. But these rules only apply
if you choose not to create the object. So you can use this factory to
supply custom implementations of those interfaces if you so desire.
statementId
- the ID of the statement that generated the call to this methodclazz
- the type of object to create
null
,
iBATIS will attempt to create the instance using it's normal
mechanism.
java.lang.InstantiationException
- if the instance cannot be created. If you
throw this Exception, iBATIS will throw a runtime exception in response and
will end.
java.lang.IllegalAccessException
- if the constructor cannot be accessed. If you
throw this Exception, iBATIS will throw a runtime exception in response and
will end.public void setProperty(java.lang.String name, java.lang.String value)
name
- value
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |