Results 1 to 3 of 3

Thread: Ibatis issue:Can't Complex Property Support Set Immediately!

  1. #1
    Join Date
    Sep 2004
    Location
    China
    Posts
    17

    Default Ibatis issue:Can't Complex Property Support Set Immediately!

    :oops: It's a Ibatis problem. I have posted the same one in the forum of ibatis.org. But I do want to post here, because I think here is more popular.

    I am a newbie to ibatis.I came against a problem when studying ibatis!

    Can't Complex Property Support Set Immediately!
    I have seen the following word in Ibatis-SqlMap 2.0
    P 26

    <quote>
    To load a List of objects,
    there is no change to the statement (see example above). The only difference required to cause the SQL
    Map framework to load the property as a List is that the property on the business object must be of type
    java.util.List or java.util.Collection.
    </quote>

    Is it mean that I must use in this type
    Class A
    {
    List bs;
    // or Collection bs;
    }
    instead of this type
    {
    Set bs
    }

    I have done a example about this.In the same program, if I change the Complex Property form List to Set(had done the nesessary job), I throw some Exception:

    Translating SQLException with SQLState 'null' and errorCode '0' and message [
    --- The error occurred in ibatis/Entity.xml.
    --- The error occurred while applying a result map.
    --- Check the entityResult.
    --- The error happened while setting a property on the result object.
    --- Cause: net.sf.cglib.beans.BulkBeanException]; SQL was [(mapped statement)] for task [SqlMapClientTemplate]
    org.springframework.jdbc.UncategorizedSQLException : (SqlMapClientTemplate): encountered SQLException [
    --- The error occurred in ibatis/Entity.xml.
    --- The error occurred while applying a result map.
    --- Check the entityResult.
    --- The error happened while setting a property on the result object.
    --- Cause: net.sf.cglib.beans.BulkBeanException]; nested exception is com.ibatis.common.jdbc.exception.NestedSQLExceptio n:
    --- The error occurred in ibatis/Entity.xml.
    --- The error occurred while applying a result map.
    --- Check the entityResult.
    --- The error happened while setting a property on the result object.
    --- Cause: net.sf.cglib.beans.BulkBeanException
    com.ibatis.common.jdbc.exception.NestedSQLExceptio n:
    --- The error occurred in ibatis/Entity.xml.
    --- The error occurred while applying a result map.
    --- Check the entityResult.
    --- The error happened while setting a property on the result object.
    --- Cause: net.sf.cglib.beans.BulkBeanException
    Caused by: net.sf.cglib.beans.BulkBeanException

    Here is my code snippet:

    <resultMap id="entityResult" class="entity">
    <result property="id" column = "ID"/>
    <result property="name" column="NAME"/>
    <result property="child" column = "ID" select="getEntityChildrenByParentEntityId"/>
    </resultMap>

    <select id="getEntityChildrenByParentEntityId" resultMap="entityChildResult" parameterClass="string">
    select ID, NAME from ENTITYCHILD WHERE PARENT_ENTITY_ID = #value#
    </select>

    //I use spring stuff

    public List find(Object object)
    {
    mapSql = ClassUtils.getShortName(object.getClass()) + "." + "find";

    List list = getSqlMapClientTemplate().queryForList(mapSql, object);

    return list;
    }

    I did could work well with List,but how can't I work with Set!

    Any suggestion and hints will be appreciated!

    Thanx in advance!

    Regards.
    Yoshiyan

  2. #2
    Join Date
    Sep 2004
    Location
    China
    Posts
    17

    Default

    I have got the answer from Clinton in the forum of iBATIS.org. He told me that iBATIS didn't support the Set type complex property now, but he would add to wish list.

    Here is the link:

    http://sourceforge.net/forum/forum.p...orum_id=206693

    CHEERS
    Yoshiyan

  3. #3
    Join Date
    Sep 2004
    Location
    Copenhagen, Denmark
    Posts
    113

    Default

    Quote Originally Posted by yoshi
    I have got the answer from Clinton in the forum of iBATIS.org. He told me that iBATIS didn't support the Set type complex property now, but he would add to wish list.

    Here is the link:

    http://sourceforge.net/forum/forum.p...orum_id=206693

    CHEERS
    Yoshiyan
    I think it was added in the just released v2.07

Similar Threads

  1. ERROR: Context initialization failed
    By makhlo in forum Architecture
    Replies: 8
    Last Post: Jul 11th, 2008, 01:41 AM
  2. Order of Bean definitions matters?
    By cfuser in forum Container
    Replies: 2
    Last Post: Oct 21st, 2005, 10:29 AM
  3. EHCaching Hibernate
    By dencamel in forum Data
    Replies: 3
    Last Post: Sep 6th, 2005, 09:03 PM
  4. Replies: 4
    Last Post: Aug 17th, 2005, 04:42 AM
  5. Replies: 2
    Last Post: May 13th, 2005, 05:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •