• Post Reply Bookmark Topic Watch Topic
  • New Topic

I am getting a new column and throwing an error in simple hibernate code  RSS feed

 
venkatPrasad Regula
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a stock pojo. I need to insert it. I wrote a hibernateUtil file and main App file. Stock has stockId, StockCode and StockName. Initially it was throwing an exception stock id should be thrown manually.

As I entered manually, it is showing a fourth column Unknown column 'SERIALVERSIONUID' in 'field list'.



App.java


HibernateUtil.java




Stock.java



Stock.hbm.xml


hibernate.cfg.xml

 
venkatPrasad Regula
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In the first line of pojo class it has the line private static final long serialVersionUID = 1L;. I removed that line too still it is throwing errors.
 
Paul Clapham
Sheriff
Posts: 22711
43
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your database table shouldn't include a column for serialVersionUID (or for any other static variable in the class) and neither should you declare it in Stock.hbm.xml.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!