Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Column 'NEXT_HI' is either not in any table in the FROM list or appears

 
Greenhorn
Posts: 25
Hibernate Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



I am using spring an hibernate annotations. for jsp page i am asking the user to enter details and i am trying to save the details in db.
>And i am giving the @generated value for the ContactId

but ia m getting the error saying like this .


/////////////////
Jan 31, 2012 11:11:15 AM com.tcs.rdt.associate.web.AssociateController associateDoAdd
INFO: isAdminRole=null
Jan 31, 2012 11:11:15 AM com.tcs.rdt.associate.web.AssociateController associateDoAdd
INFO: associate emp id=1
Jan 31, 2012 11:11:15 AM com.tcs.rdt.associate.web.AssociateController associateDoAdd
INFO: associate emp name=s
Jan 31, 2012 11:11:15 AM com.tcs.rdt.associate.web.AssociateController associateDoAdd
INFO: associate created by =0
Jan 31, 2012 11:11:15 AM com.tcs.rdt.associate.web.AssociateController associateDoAdd
INFO: associate created on = 2012-01-31 11:11:15.562
Jan 31, 2012 11:11:15 AM com.tcs.rdt.associate.web.AssociateController associateDoAdd
INFO: associate modified by = 0
Jan 31, 2012 11:11:15 AM com.tcs.rdt.associate.web.AssociateController associateDoAdd
INFO: associate modified on = 2012-01-31 11:11:15.562
Jan 31, 2012 11:11:15 AM com.tcs.rdt.associate.web.AssociateController associateDoAdd
INFO: associate password = 1
Jan 31, 2012 11:11:15 AM com.tcs.rdt.associate.web.AssociateController associateDoAdd
INFO: associatecontact contact id=0
Jan 31, 2012 11:11:15 AM com.tcs.rdt.associate.web.AssociateController associateDoAdd
INFO: associatecontact emp team=s
Jan 31, 2012 11:11:15 AM com.tcs.rdt.associate.web.AssociateController associateDoAdd
INFO: associatecontact emp tcs mail=s
Jan 31, 2012 11:11:15 AM com.tcs.rdt.associate.web.AssociateController associateDoAdd
INFO: associatecontact emp created by =0
Jan 31, 2012 11:11:15 AM com.tcs.rdt.associate.web.AssociateController associateDoAdd
INFO: associatecontact emp created on = 2012-01-31 11:11:15.562
5639324 [http-8080-1] WARN org.hibernate.util.JDBCExceptionReporter - SQL Error: -1, SQLState: 42X04
5639324 [http-8080-1] ERROR org.hibernate.util.JDBCExceptionReporter - Column 'NEXT_HI' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE statement then 'NEXT_HI' is not a column in the target table.
Jan 31, 2012 11:11:15 AM com.tcs.rdt.associate.web.AssociateController associateDoAdd
INFO: org.springframework.dao.InvalidDataAccessResourceUsageException: could not get or update next value; SQL [null]; nested exception is org.hibernate.exception.SQLGrammarException: could not get or update next value








 
ranger
Posts: 17346
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
OK, this is a Hibernate issue and you mapping of the Primary Key and its Generation mechanism. In your case you configured it to use a HILO type algorithm, and probably not what your database uses.

Moving this to the ORM forum for better answers.

Oh, and we have a CODE button when posting that adds CODE tags to you post wher eyou post your code between those tags and the code keeps its nice to read format.

So I added CODE tags for you, but please use them in the future for us. Thanks

Good Luck

Mark
 
Water proof donuts! Eat them while reading this tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic