• Post Reply Bookmark Topic Watch Topic
  • New Topic

Cannot generate a non-primary-key field in hibernate  RSS feed

Renato Bobbio Calogero
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good day every body . I got stuck with hibernate.
I mapped my bean as follows :


I defined on my Oracle 10G database that my column TASKNUMBER has a default value = 1,
and on my schema I have the field TASKNUMBER as nullable=false. But when I try to insert in my database an object of the type
PCTASK , I got complained that

could not set a field value by reflection setter of previtc.model.task.PcTask.taskNumber

This is obviously because when I instantiate an object PcTask, I do not assign any value to his TASKNUMBER field, because I want
it to be generated at the moment of the Insert statement.

Do you have any ideas on why hibernate is not automatically generate my field when I try to insert my pcTask object ? Thanks a lot!
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!