ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stephen Hasler" <Steph...@i2.co.uk>
Subject RE: mapping to an existing object model.
Date Fri, 01 Feb 2008 17:58:20 GMT
Hi

 

Thanks for the response. I can't quite see how this would work though.

The rowHandler has a single method handleRow(Object valueObject). 

 

Assuming I create a Result object via the resultMap, this would be
passed in for each row, but where would I get the score value from in
order to set it on the Result object?

 

Another problem I have understanding this is what would happen if the
Result where somewhere down a nested class hierarchy, say ResultSet,
Result, ResultItem.

Would the rowHandler method be called with objects of each of these
types as appropriate?

 

Best regards

 

Steve

 

 

________________________________

From: Jeff Butler [mailto:jeffgbutler@gmail.com] 
Sent: 29 January 2008 18:20
To: user-java@ibatis.apache.org
Subject: Re: mapping to an existing object model.

 

You can't do this automatically, but it could be done with a row
handler.

 

Jeff Butler

On Jan 28, 2008 10:55 AM, Stephen Hasler <StephenH@i2.co.uk> wrote:

Hi

 

I've been looking at iBATIS documentation/book and I can't really see
how I'd go about solving the following:-

 

I'm able to modify the database. I'm not able to modify the Java object
model.

 

In the database, I have a table called RESULT which I'd like to add a
SCORE column to.

 

The object model has an object Result which doesn't have a 'score'
property. It does however have a mechanism for adding extensible
properties.

 

public class Result

{

  ...

  public addProperty(String propertyName, String propertyValue)

  ...

 

}

 

Is it possible to map this situation?

 

 

Regards

 

Steve

________________________________

 


The information contained in this e-mail message is intended only
for the personal and confidential use of the recipient(s) named
above. This message may be an attorney-client communication and/or
work product and as such is privileged and confidential. If the
reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are
hereby notified that you have received this document in error and
that any review, dissemination, distribution, or copying of this
message is strictly prohibited. If you have received this
communication in error, please notify us immediately by e-mail, and
delete the original message.

 




-----------------------------------------
The information contained in this e-mail message is intended only
for the personal and confidential use of the recipient(s) named
above. This message may be an attorney-client communication and/or
work product and as such is privileged and confidential. If the
reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are
hereby notified that you have received this document in error and
that any review, dissemination, distribution, or copying of this
message is strictly prohibited. If you have received this
communication in error, please notify us immediately by e-mail, and
delete the original message.
Mime
View raw message