codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Updating SQL Table In Hibernate  sumeet_ghosh at 10:31 on Wednesday, April 12, 2006
 

Hi,

My mapping file query is like this


<hibernate-mapping package="com.cognizant.brokerportal.generatequote.valueobject">
<class name="GroupDetailsFormVo" table="LE_REP_SUBMIT">
<id name="submit_id1" type="java.lang.Integer" column="submit_id">
<generator class="increment"/>
</id>
<property name="submitstatus1" type="java.lang.Integer">
<column name="submit_status" />
</property>
<query name="updateStatus">
<![CDATA[from GroupDetailsFormVo groupDetailsFormVo where groupDetailsFormVo.submit_id1=:submit_id1]]>
</query>
</hibernate-mapping>


And my code is :

SessionFactory sessions = null;
Session session = null;
Transaction tx = null;
sessions = UserSessionFactory.getSessionFactory();
session = sessions.openSession();
tx = session.beginTransaction();
list1 =session.getNamedQuery("updateStatus").setInteger("submit_id1",777).list();
for(int i=0;i<list1.size();i++)
{
groupDetailsFormVo=(GroupDetailsFormVo)list1.get(i);
int eg=groupDetailsFormVo.getSubmitstatus1();
groupDetailsFormVo.setSubmitstatus1(2);
session.saveOrUpdate(groupDetailsFormVo);
}
tx.commit();
session.close();

It prints the submit status but when i try to update the same it shows me these errors

15:28:54,725 WARN [JDBCExceptionReporter] SQL Error: 208, SQLState: 42S02
15:28:54,725 ERROR [JDBCExceptionReporter] [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Invalid object name 'groupDetailsFormVo'.
15:28:54,741 ERROR [AbstractFlushingEventListener] Could not synchronize database state with session
org.hibernate.exception.SQLGrammarException: could not update: [com.cognizant.brokerportal.generatequote.valueobject.GroupDetailsFormVo#777]


Can anyone help me ????








CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: automatic updating
•  Re: calling a method in another web page
•  Re: replace
•  Re: End if error
•  How to control a collapsing menu with some tools?
•  Re: Form Submission Options
•  Re: tab order on forms
•  Re: Why don`t you do PHP or PERL?
•  Re: Disabling Button Problem


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2011