-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 
Author Message
 Post subject: Query.setProperties( Object ) question.
PostPosted: Fri Sep 19, 2003 2:33 pm 
Beginner
Beginner

Joined: Thu Sep 11, 2003 8:41 am
Posts: 35
Location: Atlanta, GA
I can't find a lot in the documentation about this guy.

Does
Query.setProperties( Object )
work with native sql queries?

Here's what I have.
QUERY
Code:
select {d.*}
from department {d}
where {d}.deptno = :deptno


passing in an object (Department) which has a
Code:
private String deptno;

on it.

Getting the following Exception:
Code:
net.sf.hibernate.QueryException: in expected: {d} [select   {d.*}
from   department {d}
where   {d}.deptno = :deptno]


{d} is defined in my query object.

When I do
Code:
Query.setString( "deptno", department.getDeptno() );

The query executes correctly.

Any ideas?
Thanx,

_________________
I am the reason spellcheck was created!!!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 19, 2003 2:57 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Sounds like a bug.

Could you make a small test.hbm.xml and java file illustrating the problem and submit it to the JIRA ? That will speed it up ;)

thanx!

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 22, 2003 12:26 pm 
Beginner
Beginner

Joined: Thu Sep 11, 2003 8:41 am
Posts: 35
Location: Atlanta, GA
Looked deeper into this.

Seems as if it is handling the Native sql call as HQL.

The query dies after parsing "department."

it's expecting a class path, ( saw indexOf( '.' ) so I assume that is what was going on. Then it sets expectingIn to true. The next thing it sees is {d} and it chokes on it. Making a little program to reproduce it, will put it in jira when it's done.

The way we are trying to do things, this is pretty crutial. Is this a trivial change I can make in my hibernate code until it is fixed?

Thanx,
Chris

_________________
I am the reason spellcheck was created!!!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 22, 2003 12:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Shino wrote:
Looked deeper into this.

Seems as if it is handling the Native sql call as HQL.

The query dies after parsing "department."

it's expecting a class path, ( saw indexOf( '.' ) so I assume that is what was going on. Then it sets expectingIn to true. The next thing it sees is {d} and it chokes on it. Making a little program to reproduce it, will put it in jira when it's done.

The way we are trying to do things, this is pretty crutial. Is this a trivial change I can make in my hibernate code until it is fixed?

Thanx,
Chris


Don't use createSQLQuery ;)

Well - the best thing you can do is to submit a test program and put it in the JIRA .... it get's WAAAY more attention when it's easy to reproduce ;)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 22, 2003 2:01 pm 
Beginner
Beginner

Joined: Thu Sep 11, 2003 8:41 am
Posts: 35
Location: Atlanta, GA
Opened an issue in Jira on this ( #353 ) and attached a tester.

Please let me know if there is something else I can do.

_________________
I am the reason spellcheck was created!!!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 13, 2003 9:00 am 
Beginner
Beginner

Joined: Thu Sep 11, 2003 8:41 am
Posts: 35
Location: Atlanta, GA
Hey guys,

Just wondering if this fix was released with 2.1 b4.

I'm still getting the same error in my code as well as the test program I uploaded to Jira.

"in expected: {tableAlias}

Thanx,

_________________
I am the reason spellcheck was created!!!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 13, 2003 10:16 am 
Beginner
Beginner

Joined: Thu Sep 11, 2003 8:41 am
Posts: 35
Location: Atlanta, GA
Nevermind... My bad.

Eclipse was pulling from an old jar. After flushing it and importing fresh it worked fine.

Thanks guys!

_________________
I am the reason spellcheck was created!!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 7 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.