Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not able to insert data

 
Selva Varadhan
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am getting fowllowing exception when i try to insert the data using hibernate

INFO: Named query checking : enabled
13 Aug, 2007 11:11:52 AM org.hibernate.impl.SessionFactoryImpl <init>
INFO: building session factory
13 Aug, 2007 11:11:53 AM org.hibernate.impl.SessionFactoryObjectFactory addInstance
INFO: Not binding factory to JNDI, no JNDI name configured
Inserting Record
Hibernate: insert into CITY (CITY_NAME) values (?)
could not insert: [com.quanta.movie.domain.City]
13 Aug, 2007 11:11:53 AM org.hibernate.util.JDBCExceptionReporter logExceptions
WARNING: SQL Error: 1364, SQLState: HY000
13 Aug, 2007 11:11:53 AM org.hibernate.util.JDBCExceptionReporter logExceptions
SEVERE: Field 'CITY_ID' doesn't have a default value


Model object



Please help me on this issue..
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What's your database that you are using? AUTO will use the default database way of generating IDs, so for instance, using MySQL which has primary Keys that auto increment their value when they receive and insert statement, versus Oracle which requires a Sequence table.

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic