ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nic Werner <wer...@sonoma.edu>
Subject Re: Nested Beans?
Date Tue, 12 Apr 2005 18:44:49 GMT
Thanks for the guidance Brandon, but I'm still lost after checking 
everything: I want this 'select' command to grab the deviceid, and 
populate the DeviceBean using this unique tag, is that possible?

ReservationBean holds a DeviceBean. The DB table has a field called 
'DeviceID' which should refer to the DeviceBean.getTag()

I get the error:  Caused by: com.ibatis.common.beans.ProbeException: 
There is no WRITEABLE property named 'tag' in class 'java.lang.String'

Snippet of my ReservationBean:
public final class ReservationBean extends ActionForm {
        private String ipAddress="";
        private DeviceBean device = new DeviceBean();

<resultMap id="ReservationBean" 
        <result property="ipAddress" column="ipaddress"/>
        <result property="device.tag" column="deviceid"/>
    <select id="selectReservations" resultMap="ReservationBean">
        FROM dhcp_reservation       

- Nic.

Brandon Goodin wrote:

>You can use '.'  (dot) notation. So, if you pass in Reservation as
>your parameter class you can acess the device id with 'device.id'
>(assuming 'id' is the name of your id propety in the Device class)
>On Apr 7, 2005 12:58 PM, Nic Werner <werner@sonoma.edu> wrote:
>>    The archives aren't searchable right now
>>(http://incubator.apache.org/ibatis/site/mailinglists.html), so I have
>>this question:
>>I have a Bean (Reservation), with another Bean (Device) inside it. My
>>database just contains the DeviceID in the Reservation table - where/how
>>can I use the getter inside the nestedbean to get this DeviceID out?
>>- Nic.

View raw message