ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JeanNiBee <John.Bate...@nuance.com>
Subject Nested attributes / class instances and PropertyClass.
Date Tue, 20 Jan 2009 01:51:34 GMT

I'm trying to determine if this can be done in iBatis using a query (insert).

Class Person {
    // for brevity assume the setters / getters are public just not shown
    private Address address;
    private String name;
}

Class Address {
    // Same here setters / getters just not shown
    private String city;
}

Can I do this, (or if not how can I achieve this same result) in my XML file
that I execute when running a query.

the Person table has only 2 fields.. name and city.

<insert id="insertEngine" parameterClass="com.foo.bar.Person">

    INSERT INTO person_table 
        ( name, city ) 
    VALUES (  #name#, #address.city# )

</insert>



-- 
View this message in context: http://www.nabble.com/Nested-attributes---class-instances-and-PropertyClass.-tp21555576p21555576.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Mime
View raw message