Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
incorrect mapping of results
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  7 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Danny Stommen  
View profile  
 More options Oct 11 2011, 9:26 am
From: Danny Stommen <da...@bannerconnect.net>
Date: Tue, 11 Oct 2011 06:26:05 -0700 (PDT)
Local: Tues, Oct 11 2011 9:26 am
Subject: incorrect mapping of results
Hi All,

I'm completely lost with a problem.  I'm trying to select data
dynamically. To do this, I've a List<string> containing the columns I
want to select, which I pass into the sql statement and use the
iterate tag to populate this in the sql statment.

This looks like:
    SELECT
        <iterate property="columns" conjunction="," open="" close="">
            $columns[]$
        </iterate>
      FROM my_table
      WHERE ...

My table contains the following columns (simplified): AdvertiserId,
Impression, Clicks (all integer)

When I populate the List I'm passing in with the first 2 columns, it
works fine. When I restart my program en add all 3 columns, it still
works fine.

But, if I run the query with the first 2 columns, add the last column
to the list en re-run the qeury again (without restarting), the
results are not mapped correctly. The strange thing is that the
results of Clicks are mapped to Impressions, and Clicks is always 0.

I'm using ResultClass="MyObject", because of the dynamic result I
can't use a ResultMap. Any idea what could be causing this? I don't
use any caching.

Another strange thing, when I change the ResultClass to Hashtable, I
can see that all correct property names have the correct values...


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael McCurrey  
View profile  
 More options Oct 11 2011, 9:45 am
From: Michael McCurrey <mmccur...@gmail.com>
Date: Tue, 11 Oct 2011 06:45:12 -0700
Local: Tues, Oct 11 2011 9:45 am
Subject: Re: incorrect mapping of results

Are you using a ResultMap?  As of right now if you use a ResultMap and you
have that third column mapped but it isn't in your Select Statement, it will
fail.

On Tue, Oct 11, 2011 at 6:26 AM, Danny Stommen <da...@bannerconnect.net>wrote:

--
Michael J. McCurrey
Read with me at http://www.mccurrey.com
http://chaoticmindramblings.blogspot.com/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Danny Stommen  
View profile  
 More options Oct 12 2011, 4:56 am
From: Danny Stommen <da...@bannerconnect.net>
Date: Wed, 12 Oct 2011 01:56:17 -0700 (PDT)
Local: Wed, Oct 12 2011 4:56 am
Subject: Re: incorrect mapping of results
No, as metioned in my first post, I'm using ResultClass because I
don't know in advance which column are requested.

I simplified my explanation to 3 columns, but the actual table is
containing 12 columns. Because this is a rather large reporting table,
I want to prevent that each time all columns are retrieved.

On Oct 11, 3:45 pm, Michael McCurrey <mmccur...@gmail.com> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michael McCurrey  
View profile  
 More options Oct 12 2011, 8:15 am
From: Michael McCurrey <mmccur...@gmail.com>
Date: Wed, 12 Oct 2011 05:15:33 -0700
Local: Wed, Oct 12 2011 8:15 am
Subject: Re: incorrect mapping of results

Interesting, can you post an example of it failing?  Either your SqlMap &
Class or a failing test?

On Wed, Oct 12, 2011 at 1:56 AM, Danny Stommen <da...@bannerconnect.net>wrote:

--
Michael J. McCurrey
Read with me at http://www.mccurrey.com
http://chaoticmindramblings.blogspot.com/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Danny Stommen  
View profile  
 More options Oct 12 2011, 9:07 am
From: Danny Stommen <da...@bannerconnect.net>
Date: Wed, 12 Oct 2011 15:07:23 +0200
Local: Wed, Oct 12 2011 9:07 am
Subject: Re: incorrect mapping of results

The sql map looks like this

    <select id="Select" resultClass="Network" parameterClass="Hashtable">
      SELECT
        <iterate property="columns" conjunction="," open="" close="">
            $columns[]$
        </iterate>
      FROM rep_network_daily
      WHERE
        MemberId = #memberId#
        AND ner_Date BETWEEN #startDate# AND #endDate#
      <isNotEmpty property="groupBy" prepend="GROUP BY">
        <iterate property="groupBy" conjunction="," open="" close="">
          $groupBy[]$
        </iterate>
      </isNotEmpty>
    </select>

The Network.cs is attached.

On Wed, Oct 12, 2011 at 2:15 PM, Michael McCurrey <mmccur...@gmail.com>wrote:

  Network.cs
4K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Danny Stommen  
View profile  
 More options Oct 17 2011, 8:23 am
From: Danny Stommen <da...@bannerconnect.net>
Date: Mon, 17 Oct 2011 05:23:23 -0700 (PDT)
Local: Mon, Oct 17 2011 8:23 am
Subject: Re: incorrect mapping of results
Hi Micheal,

Did you have any chance to take a look at the problem?

Thanks,
Danny

On Oct 12, 3:07 pm, Danny Stommen <da...@bannerconnect.net> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Danny Stommen  
View profile  
 More options Nov 2 2011, 7:49 am
From: Danny Stommen <da...@bannerconnect.net>
Date: Wed, 2 Nov 2011 04:49:36 -0700 (PDT)
Local: Wed, Nov 2 2011 7:49 am
Subject: Re: incorrect mapping of results
No one any idea?

On Oct 17, 1:23 pm, Danny Stommen <da...@bannerconnect.net> wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »