Okay, will try this now then.
Thanks
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159295#4159295
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159295
___
jboss-user maili
How about changing your query to return the entire User object instead of just
the ids? Maybe like this:
SELECT USR FROM USER USR, USERWATCH UW WHERE USR.ADDEDBYID =1 AND USR.COUNTRY
= CAS
| E WHEN (UW.COUNTRY is null) THEN USR.COUNTRY ELSE UW.COUNTRY END AND
USR.ALIVE = 'A'
See if that wo
I just checked the javadoc of javax.persitence.Query, method setFirstResult and
it says:
anonymous wrote : Query setFirstResult(int startPosition)
|
| Set the position of the first result to retrieve.
|
| Parameters:
| startPosition - the start position of the first re
"jaikiran" wrote : The indexing starts with 1 and not 0. So when
setFirstResult(0) is used, it probably gets ignored.
I'm sorry. i re-read the javadocs and it appears the indexing does start from 0.
"rabbiaqaswar" wrote :
| So does that mean that the query is supposed to return Object[] conta
So does that mean that the query is supposed to return Object[] containg the
result & the index, even if i am only retreiving a single value in the query?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159283#4159283
Reply to the post :
http://www.jboss.c
The indexing starts with 1 and not 0. So when setFirstResult(0) is used, it
probably gets ignored.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159282#4159282
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159282
_
Infact it gives ids only when the setFirstResult is set at 0 i.e.
setFirstResult(0). When the value of setFirstResult is anything other than 0,
the query returns Object[]'s.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159273#4159273
Reply to the post :
One thing which I have noticed is that the query returns ids only for the first
ten records. After that, it always returns the Object[] e.g. setFirstResult(20)
& setMaxResults(10), also gives Object[]'s.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159269#4
I did, three days back but got no reply from there:
http://forum.hibernate.org/viewtopic.php?t=987845&highlight=
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159267#4159267
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply
I would suggest posting in the Hibernate forums instead of filing a bug.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159261#4159261
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159261
:) Thanks
Should i report it as a bug at Hibernate? Maybe it is something wrong at their
end?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159186#4159186
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4159186
__
I am running out of ideas. The only other suggestion i can give you is to use
the correct (perhaps the latest) JDBC driver of Oracle.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4159164#4159164
Reply to the post :
http://www.jboss.com/index.html?module=bb&
This property is already set in the persistence.xml file along with the batch
size property which i mentioned earlier.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158696#4158696
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mod
I dont have a setup which has Oracle on it. I don't know why the query is
getting generated incorrectly.
Can you try adding the following property to your persistence.xml and see if it
helps:
|
|
| ...
|
|
|
It is Oracle 9i. Here is the datasource file:
|
| UserDS
|
| false
|
oracle.jdbc.xa.client.OracleXADataSource
| jdbc:oracle:thin:@mach:1521:ORAUR
| name
| password
|
|
|
|
org.jboss.resource.adapter.jdbc.vendor.OracleEx
Which database server/version do you use? Can you post the datasource file that
you have configured?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158667#4158667
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4158667
Typo error in the previous post, for the first scenario, its:
setfirstResult(0) and setMaxResults(10)
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158631#4158631
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4158631
Thanks.
I enabled Trace and the two queries executed internally are actually different!
Here is the query which is executed with the setfirstResult(0) and
setMaxResults(20):
select * from (SELECT DISTINCT USR.USERID FROM USER USR, USERWATCH UW WHERE
USR.ADDEDBYID =1 AND
| USR.COUNTRY = CAS
I don't believe the jdbc batch size would affect your query output.
For further logging options, see this
http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#configuration-logging
And yes, do look for the actual query being fired by Hibernate in the logs.
Something similar to:
2008
Do you think it has anything to do with the following property in
persistence.xml file:
Will try debugging through Trace.
Thanks
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158582#4158582
Reply to the post :
http://www.jboss.com/index.html?module=bb&
I have a simple native query:
select distinct usr.userid from user usr where usr.name like '%jai%'
which returns me the expected output when used with setFirstResult and
setMaxResult. Not sure whether its a problem with your query or something else.
You can try enabling TRACE level logs of Hibe
Anyone? I still cannot solve the issue :(
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4158190#4158190
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4158190
___
jboss-user ma
Following is the sql query:
SELECT DISTINCT USR.USERID FROM USER USR, USERWATCH UW WHERE USR.ADDEDBYID =1
AND USR.COUNTRY = CASE WHEN (UW.COUNTRY is null) THEN USR.COUNTRY ELSE
UW.COUNTRY END AND USR.ALIVE = 'A'
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p
Looking at the output, it looks like along with the ids, even the record count
(ex: 11, 12, 13 etc) is being returned. Without looking at the actual query
which you are using i can't say what the problem is.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=
Since the query was returning an Object array, i printed its contents
if(ids != null && !ids .isEmpty()){
|for (Iterator it = ids.iterator(); it.hasNext();) {
|
| Object[] obj = (Object[])it.next();
| System.out.println(""+Arrays.deepToString(obj));
|
|}
| }
and
It is a SQL join query which returns primary keys of type BigDecimal of a
database table.
It workds fine without paging i.e. return 20 ids and when the first ten records
are fetched using the setFirstResult & setMaxResults methods. The problem
occurs when the first result is set to 10 and max
What does your strQuery look like?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4157874#4157874
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4157874
___
jboss-user mailing
27 matches
Mail list logo