-->
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.  [ 3 posts ] 
Author Message
 Post subject: Prob. i.e. "Invalid Identifier" in HSQL
PostPosted: Sat Dec 01, 2007 1:35 am 
Newbie

Joined: Sat Dec 01, 2007 1:24 am
Posts: 7
Location: Pune
Hi All,
In my application , while executing HSQL i m getting this error "Invalid Identifier" as "DEPARTMENT"

Sub part of Query is,
from User where
and department in(select deptId from Department where lower(deptName) like lower('"+department.getDeptName().trim()+"%'))"

In Business object of User,
department object is a "Has a part".

Mapping part is,
<many-to-one name="Department" column="dept_no" unique="false"
class="com.greenlight.testxpert.persistence.Department"
cascade="none" not-null="false"
foreign-key="FK_USR_DEPT" />

dept_no is foriegn key of department table.

Please help me to solve this problem.

from,
Gajendra


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 02, 2007 11:25 am 
Beginner
Beginner

Joined: Tue Nov 27, 2007 9:44 am
Posts: 46
Hi Gajendra,

are you trying to execute SQL or HQL?

And how exactly are you calling it? Can you please post your code?

Furthermore, before posting it would help if you read this.

Regards,
Frank


Top
 Profile  
 
 Post subject:
PostPosted: Mon Dec 03, 2007 1:02 am 
Newbie

Joined: Sat Dec 01, 2007 1:24 am
Posts: 7
Location: Pune
hi frank,

Problem has been solved...
By changing mapping information,
There i have changed the column name, which is primary key of another table. I use same name in my current table i.e. foreign key "gdm_id"

<many-to-one name="Department" column="gdm_id" unique="false"
class="com.greenlight.testxpert.persistence.Department"
cascade="none" not-null="false"
foreign-key="FK_USR_DEPT" />

Is it a hibernate rule for foreign key to use same name as primary key?

Regards,
Gajendra


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.