• Post Reply Bookmark Topic Watch Topic
  • New Topic

Use default value of SQL

 
Patrick Kok
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a table which contains some fields ie. record_time, modify_date, are set to now() by default in Postgresql.
Hibernate maps these field and replaces them with null value when they are inserted.
The mapping file needs record_time and modify_date for select.

Is there any way to allow Hibernate to avoid inserting null and allow using of default value of Postgresql?

I use Postgresql 8.4 and Hibernate 3.3.2

Thanks
 
Patrick Kok
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay, I solved the problem by appending insert="false" against the property entries.
thanks, anyway
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!