Subject | FW: Urgent Help Needed--Plz help me |
---|---|
Author | rambabu.piridi@wipro.com |
Post date | 2006-07-25T12:42:13Z |
Hi thanks for the reply,
I also tried the option
i.e.
public List getProperties(int fromRecord, int recordsPerTransaction) {
List list =
SqlMapClient.queryForList("getProperties",null,fromRecord,recordsPerTran
saction)
}
If the databse contains data like
user_info
=======
User_Id Name Password
------- ---- ---------
1 Test1 Test1
2 Test2 Test2
3 Test3 Test3
- - -
- - -
If I have 10 records like this
And the second table extension_info contains the data
User_id Property_name Property_Value
------- ------------- ---------------
1 City LONDON
1 Country AMERICA
2 null null
3 City ABC
3 Country XYZ
- - -
- - -
I am mapping this data to a java object called User.java which contains
the methods to set/get the properties.
When I execute the query
Select first 5 skip 0 * from usr_info left outer join extension_info on
usr_basic.user_id=extension_info.userId;
It is retriving
user_id Name Password User_id
property_name property_value
------- ---- -------- -------
------------- --------------
1 Test1 Test1 1
City LONDON --
|----Reresents One User Object
1 Test1 Test1 1
Country AMERICA--
2 Test2 Test2 2
null null -----Represents the Second
User
3 Test3 Test3 3
City ABC---
|-------Reresents the third User
3 Test3 Test3 3
Country XYZ---
So it is retriving 3 users information.
But my requirement is to get five users information. I am trying all
possible ways, but I am not able to find the solution.
Can you please suggest me, how to get the User objects between the
specified range.
Thanks n Regards,
================
Rambabu
-----Original Message-----
From: Jerome Gagner [mailto:phpmonkey@...]
Sent: Tuesday, July 25, 2006 12:22 PM
To: user-java@...
Subject: Re: -------Pagination----Need help
What database? You can do it in queryForList and have Ibatis limit it,
but I wouldn't recommend doing it that way.
I also tried the option
i.e.
public List getProperties(int fromRecord, int recordsPerTransaction) {
List list =
SqlMapClient.queryForList("getProperties",null,fromRecord,recordsPerTran
saction)
}
If the databse contains data like
user_info
=======
User_Id Name Password
------- ---- ---------
1 Test1 Test1
2 Test2 Test2
3 Test3 Test3
- - -
- - -
If I have 10 records like this
And the second table extension_info contains the data
User_id Property_name Property_Value
------- ------------- ---------------
1 City LONDON
1 Country AMERICA
2 null null
3 City ABC
3 Country XYZ
- - -
- - -
I am mapping this data to a java object called User.java which contains
the methods to set/get the properties.
When I execute the query
Select first 5 skip 0 * from usr_info left outer join extension_info on
usr_basic.user_id=extension_info.userId;
It is retriving
user_id Name Password User_id
property_name property_value
------- ---- -------- -------
------------- --------------
1 Test1 Test1 1
City LONDON --
|----Reresents One User Object
1 Test1 Test1 1
Country AMERICA--
2 Test2 Test2 2
null null -----Represents the Second
User
3 Test3 Test3 3
City ABC---
|-------Reresents the third User
3 Test3 Test3 3
Country XYZ---
So it is retriving 3 users information.
But my requirement is to get five users information. I am trying all
possible ways, but I am not able to find the solution.
Can you please suggest me, how to get the User objects between the
specified range.
Thanks n Regards,
================
Rambabu
-----Original Message-----
From: Jerome Gagner [mailto:phpmonkey@...]
Sent: Tuesday, July 25, 2006 12:22 PM
To: user-java@...
Subject: Re: -------Pagination----Need help
What database? You can do it in queryForList and have Ibatis limit it,
but I wouldn't recommend doing it that way.
On 7/24/06, rambabu.piridi@... <rambabu.piridi@...> wrote:
>
>
>
>
> Hi,
>
> I have two tables user_info and user_dynamic_info
>
> the following is the table structure
>
> user_info
> =======
> user_id primarykey
> user_name
> user_password
>
> user_dynamic_info
> =============
> user_id ForeignKey(user_info)
> property_name
> property_value
>
> I have one bean class which maps the information from these tables to
> one java Object
>
> public class User
> {
> String userId;
> List dynamicInfo;
> }
>
>
> Now the table contains 200 records, and I want to retrieve 10 records
> every time when i invoke the select query.
>
> inside the method
>
> public List getProperties(int fromRecord, int recordsPerTransaction) {
> List list = SqlMapClient.queryForList("getProperties",null)
> }
>
> It is working fine when the records count is more than 500. But when
> my Db contains lessthan 500 records, the result is unpredictable.
>
> my query is
>
>
> select BASIC.USER_ID,BASIC.USER_PWD,BASIC.USER_NAME EXTENSIN.USER_ID,
> EXTENSIN.PROPERTY_NAME,EXTENSIN.PROPERTY_VALUE from USER_INFO BASIC
> LEFT OUTER JOIN USER_DYNAMIC_INFO EXTENSIN ON
BASIC.USER_ID=EXTENSIN.USER_ID.
>
> is there any way to pass the fromRecord, recordsPerTransaction to the
> query
>
> Can any one help me in this regard,
>
>
> Thanks n Regards,
> ==============
> Rambabu
>
> The information contained in this electronic message and any
> attachments to this message are intended for the exclusive use of the
> addressee(s) and may contain proprietary, confidential or privileged
> information. If you are not the intended recipient, you should not
> disseminate, distribute or copy this e-mail. Please notify the sender
> immediately and destroy all copies of this message and any
attachments.
>
> WARNING: Computer viruses can be transmitted via email. The recipient
> should check this email and any attachments for the presence of
> viruses. The company accepts no liability for any damage caused by any
> virus transmitted by this email.
>
> www.wipro.com
>