-->
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: java.sql.SQLException: Invalid column index
PostPosted: Wed Mar 18, 2009 10:26 am 
Newbie

Joined: Wed Mar 14, 2007 4:10 am
Posts: 4
Hi,

I am facing following issue in hibernate 3

I have my *.hbm.xml file in which there are properties, sql-insert query and sql-query.

In property there is one special field (F1) which is not required in insert statement but is required in select (sql-query).
i.e. if i dont put F1 in insert and put in select, it gives the exception that missing column index because It binds all propety to fields

If i delelte the property, delete that field from insert and select too, it will give null value in select statement.

Please let me know how i can achieve my requirement i.e.

one property (F1) which is not required in insert statement (sql-insert) but is required in select (sql-query).

~Aman


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 18, 2009 11:12 am 
Expert
Expert

Joined: Fri Jan 30, 2009 1:47 am
Posts: 292
Location: Bangalore, India
Specify that property as:
Code:
<property name="f1" column="F1" update="false" insert="false"/>

So hibernate will ignore the property during update and insert.

_________________
Regards,
Litty Preeth


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 18, 2009 11:48 am 
Newbie

Joined: Wed Mar 14, 2007 4:10 am
Posts: 4
Thanks a lot.. It reslved my issue :) :)


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.