Donovan Frew (JIRA | 1 Jan 2007 21:54
Picon
Favicon

Commented: (IBATIS-352) Problems with Complex Properties + Sets & enums


    [
http://issues.apache.org/jira/browse/IBATIS-352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12461643
] 

Donovan Frew commented on IBATIS-352:
-------------------------------------

I too am having the same issue as Paul and Andrew, however I believe that part of my problem is related to the
fact that I am not sure how to specify my result map for a Set of Enums.  

The documentation on complex collection properties to avoid N+1 selects seems to only apply to javabeans
(as they can be instantiated as opposed to Enum types which cannot).  I therefore opted to use the other
option and came up with this :

    public class User {
        private int id;
        private String name;
        private Set<Role> roles;  // Role is an Enum type

        // assume appropriate getters and setters
    }

// -----------------

    <resultMap id="user-result" class="User">
        <result property="id" column="ID"/>
        <result property="name" column="NAME"/>
        <result property="roles" column="ID" select="get-resource-roles"   typeHandler="com.ackee.herring.dao.ibatis.RoleTypeHandlerCallback"/>
    </resultMap>
(Continue reading)

Andrew.X.Lewis | 2 Jan 2007 23:17

Offer of contribution....any interest?


The team I work on is currently using iBatis for Java for all of our JDBC
data access with great results, and having found the benefits of it, we are
now working towards a data access solution that has a slightly larger scope
than iBatis, but wit the same benefits and general philosophy. Specifically
we need to retrieve data not only from JDBC sources, but also from other
sources such as TIBCO and , LDAP. We are looking to have the same ease of
use and power of iBatis with these sources, and will be doing all of the
development and testing to accomplish this.

What we really do not want to do however is try to fork the project. so we
are faced with either building functionality similar to iBatis for the
other sources, our strong preference extending iBatis to handle these
sources. For reviewing the source code, the primary  outward change would
be to create additional parallel methods using a more abstract iBatis
specific class or interface in place of Connection and SQLException.
Obviously the internal changes would need to be more involved.

Were this development completed and offered as a contribution, what is the
current feeling on how well it would be received?

Many thanks  in advanced.....

---------------------------------------------------------------------
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
(Continue reading)

Clinton Begin | 3 Jan 2007 01:30
Picon

Re: Offer of contribution....any interest?

I would appreciate the work, and as a team member I'd be honored that you would think to put this under the iBATIS umbrella. 

However, I think it's such a diversion from the central purpose of iBATIS that it would threaten to blur what iBATIS is. 

I would rather see it as a fork.  Forks aren't bad when they're doing something completely different.  They're only bad when they do exactly the same thing so as to confuse the meaning of the framework.

A LDAP or TIBCO data mapping framework would clearly be differentiated from a JDBC framework.

Just my initial thoughts...

Clinton

On 1/2/07, Andrew.X.Lewis <at> healthnet.com <Andrew.X.Lewis <at> healthnet.com> wrote:

The team I work on is currently using iBatis for Java for all of our JDBC
data access with great results, and having found the benefits of it, we are
now working towards a data access solution that has a slightly larger scope
than iBatis, but wit the same benefits and general philosophy. Specifically
we need to retrieve data not only from JDBC sources, but also from other
sources such as TIBCO and , LDAP. We are looking to have the same ease of
use and power of iBatis with these sources, and will be doing all of the
development and testing to accomplish this.

What we really do not want to do however is try to fork the project. so we
are faced with either building functionality similar to iBatis for the
other sources, our strong preference extending iBatis to handle these
sources. For reviewing the source code, the primary  outward change would
be to create additional parallel methods using a more abstract iBatis
specific class or interface in place of Connection and SQLException.
Obviously the internal changes would need to be more involved.

Were this development completed and offered as a contribution, what is the
current feeling on how well it would be received?


Many thanks  in advanced.....



---------------------------------------------------------------------
This message, together with any attachments, is
intended only for the use of the individual or entity
to which it is addressed. It may contain information
that is confidential and prohibited from disclosure.
If you are not the intended recipient, you are hereby
notified that any dissemination or copying of this
message or any attachment is strictly prohibited. If
you have received this message in error, please notify
the original sender immediately by telephone or by
return e-mail and delete this message, along with any
attachments, from your computer. Thank you.

---------------------------------------------------------------------

Marcello Finessi (JIRA | 3 Jan 2007 16:50
Picon
Favicon

Created: (IBATIS-379) com.ibatis.common.beans.ProbeException: There is no READABLE property named 'I_PARAM_INT_1'

com.ibatis.common.beans.ProbeException: There is no READABLE property named 'I_PARAM_INT_1'
-------------------------------------------------------------------------------------------

                 Key: IBATIS-379
                 URL: https://issues.apache.org/jira/browse/IBATIS-379
             Project: iBatis for Java
          Issue Type: Bug
          Components: SQL Maps
    Affects Versions: 2.3.0, 2.2.0
         Environment: jre 1.5
Windows XP 
eclipse / WebSphereStudio
tomcat / WebSphere
Oracle 9.x
            Reporter: Marcello Finessi
            Priority: Critical

Hi the IBATIS team.

I've a java Bean with a getter method named getI_PARAM_INT_1 that returns an int type.

I've noted that the method dropCase in class com.ibatis.common.beans.ClassInfo does not work properly
for names like this.

the code ...
 if (name.length() == 1 || (name.length() > 1 && !Character.isUpperCase(name.charAt(1)))) {
      name = name.substring(0, 1).toLowerCase(Locale.US) + name.substring(1);
    }...

will cause the assignement of: name ="i_PARAM_INT_1" because the if condition does not consider that
could exists the character  '_' 
in fact the expression     !Character.isUpperCase(name.charAt(1))  that is !Character.isUpperCase('_')
returns true.

This cause an error like this:  com.ibatis.common.beans.ProbeException: There is no READABLE property
named 'I_PARAM_INT_1'

I  think that the condition should be completed considering just alphabetics characters. Like this?....
 if (name.length() == 1 || (name.length() > 1 &&   Character.isLetter(name.charAt(1)) && 
!Character.isUpperCase(name.charAt(1)))) {

Thank you.

Tor Tuga (JIRA | 3 Jan 2007 19:55
Picon
Favicon

Created: (IBATIS-380) Alter SqlMap loading so that <sql> fragments and <resultMap> blocks in all XML files are loaded in one pass before all other data is loaded in second pass

Alter SqlMap loading so that <sql> fragments and <resultMap> blocks in all XML files are loaded in one pass
before all other data is loaded in second pass
----------------------------------------------------------------------------------------------------------------------------------------------------------

                 Key: IBATIS-380
                 URL: https://issues.apache.org/jira/browse/IBATIS-380
             Project: iBatis for Java
          Issue Type: Improvement
          Components: SQL Maps
    Affects Versions: 2.3.0
         Environment: Fedore Core 3, Java 1.5, Tomcat 5.5
            Reporter: Tor Tuga

I have an object that contains a fragment used by a second object. The first object, however, uses a
resultMap in the second object. So they cannot be loaded because neither can exclusively come first!

Gilles Bayon (JIRA | 3 Jan 2007 21:23
Picon
Favicon

Created: (IBATISNET-202) QueryForDictionary does not process select property

QueryForDictionary  does not process select property
----------------------------------------------------

                 Key: IBATISNET-202
                 URL: https://issues.apache.org/jira/browse/IBATISNET-202
             Project: iBatis for .NET
          Issue Type: Bug
          Components: DataMapper
    Affects Versions: DataMapper 1.5.1
            Reporter: Gilles Bayon
         Assigned To: Gilles Bayon
             Fix For: DataMapper 1.6

Reported by Christopher DeGuise

Gilles Bayon (JIRA | 3 Jan 2007 21:42
Picon
Favicon

Closed: (IBATISNET-202) QueryForDictionary does not process select property


     [
https://issues.apache.org/jira/browse/IBATISNET-202?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gilles Bayon closed IBATISNET-202.
----------------------------------

    Resolution: Fixed

In SVN

> QueryForDictionary  does not process select property
> ----------------------------------------------------
>
>                 Key: IBATISNET-202
>                 URL: https://issues.apache.org/jira/browse/IBATISNET-202
>             Project: iBatis for .NET
>          Issue Type: Bug
>          Components: DataMapper
>    Affects Versions: DataMapper 1.5.1
>            Reporter: Gilles Bayon
>         Assigned To: Gilles Bayon
>             Fix For: DataMapper 1.6
>
>
> Reported by Christopher DeGuise

Paul Benedict (JIRA | 4 Jan 2007 06:03
Picon
Favicon

Commented: (IBATIS-352) Problems with Complex Properties + Sets & enums


    [
https://issues.apache.org/jira/browse/IBATIS-352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462127
] 

Paul Benedict commented on IBATIS-352:
--------------------------------------

I actually solved the problem, but it is totally not obvious :-) 

<typeHandler javaType="org.xyz.Role" ... />

<resultMap id="userMap" class="User" groupBy="id">
  <result property="id" column="u_id" />
  <result property="roles" resultMap="NameSpace.roleResult"
</resultMap>

<resultMap id="roleResult" class="Role">
  <result property="value" column="ur_id" />
</resultMap>

It turns out when there is a result map with just one item in it, and you provide a type handler, Ibatis will
treat it "like" a primitive type -- the first result is the value. Who would have thought!!

This is really not obvious at all. I recommend IBATIS adds a resultClass to the <result> tag so that users
don't need yet another map to translate single values (enums and primitives in collections especially).
Hence this would become:

<resultMap id="userMap" class="User" groupBy="id">
  <result property="id" column="u_id" />
  <result property="roles" column="ur_id" resultClass="Role" />
</resultMap>

> Problems with Complex Properties + Sets & enums
> -----------------------------------------------
>
>                 Key: IBATIS-352
>                 URL: https://issues.apache.org/jira/browse/IBATIS-352
>             Project: iBatis for Java
>          Issue Type: Bug
>          Components: SQL Maps
>    Affects Versions: 2.2.0
>         Environment: JDK 1.5, IBATIS SQL Maps 2.2.0.638, Spring 2.0
>            Reporter: Andrew Bethell
>         Attachments: domain.zip, join-resultmap with enum.txt, lazy-load with set.txt, sqlmap.zip
>
>
> There doesnt seem to be support for lazy-loading complex properties of type 'java.util.Set', only List
collections -  (stack trace attached to this issue).
> I have to use Set collections at the moment, as when I upgraded from IBATIS SQLMaps 2.17 to 2.22, the
'groupBy' attribute for resultmaps did not seem to make data in (List) complex properties distinct by ID,
where as in version 2.17 this was the case.
> Strangely though, when loading complex properties with joins+resultMaps, Set properties work
correctly - except when items in the Set contain enum types (stack trace attached for this too).

Donovan Frew (JIRA | 4 Jan 2007 22:17
Picon
Favicon

Commented: (IBATIS-352) Problems with Complex Properties + Sets & enums


    [
https://issues.apache.org/jira/browse/IBATIS-352?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12462324
] 

Donovan Frew commented on IBATIS-352:
-------------------------------------

Thanks Paul.  I tried your solution and it worked like a charm.  I had figured that I was approaching it
incorrectly.  I guess these discussions will help to improve the documentation.

> Problems with Complex Properties + Sets & enums
> -----------------------------------------------
>
>                 Key: IBATIS-352
>                 URL: https://issues.apache.org/jira/browse/IBATIS-352
>             Project: iBatis for Java
>          Issue Type: Bug
>          Components: SQL Maps
>    Affects Versions: 2.2.0
>         Environment: JDK 1.5, IBATIS SQL Maps 2.2.0.638, Spring 2.0
>            Reporter: Andrew Bethell
>         Attachments: domain.zip, join-resultmap with enum.txt, lazy-load with set.txt, sqlmap.zip
>
>
> There doesnt seem to be support for lazy-loading complex properties of type 'java.util.Set', only List
collections -  (stack trace attached to this issue).
> I have to use Set collections at the moment, as when I upgraded from IBATIS SQLMaps 2.17 to 2.22, the
'groupBy' attribute for resultmaps did not seem to make data in (List) complex properties distinct by ID,
where as in version 2.17 this was the case.
> Strangely though, when loading complex properties with joins+resultMaps, Set properties work
correctly - except when items in the Set contain enum types (stack trace attached for this too).

Gilles Bayon (JIRA | 4 Jan 2007 22:35
Picon
Favicon

Closed: (IBATISNET-182) Lazy load support for Items


     [
https://issues.apache.org/jira/browse/IBATISNET-182?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gilles Bayon closed IBATISNET-182.
----------------------------------

       Resolution: Fixed
    Fix Version/s: DataMapper 1.6
         Assignee: Gilles Bayon

In SVN

> Lazy load support for Items
> ---------------------------
>
>                 Key: IBATISNET-182
>                 URL: https://issues.apache.org/jira/browse/IBATISNET-182
>             Project: iBatis for .NET
>          Issue Type: Sub-task
>          Components: DataMapper
>    Affects Versions: DataMapper 1.6
>            Reporter: David Marzo
>         Assigned To: Gilles Bayon
>            Priority: Minor
>             Fix For: DataMapper 1.6
>
>         Attachments: LazyLoadForItems.patch
>
>
> Attach a patch for the feature of lazy load Items, for the DataMapper version 1.6
> Ej: 
>  Worker w = loadWorker(idWorker);
>  w.Boss.SayHello(); //Loaded by lazy load
> Worker<*--Aggregation--1>Boss


Gmane