• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

DB default values with CMPs

 
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
We are using a CMP for data access. One of the fields is defined in our database (Oracle) as non-null and has a default value. However, if that field is not set on the CMP, the create() method ends up trying to insert a null into the field, which doesn't work. Is there any way to have it simply leave that field out of the insert and let the database use its default?
 
Ranch Hand
Posts: 81
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Most of the app. servers would not support such a feature. The app. server that typically supports such advanced features is weblogic. If you are using one check out its documentation else my humble suggestion is to set the default value explicitly in your ejbCreate implementation.
 
Greg Charles
Sheriff
Posts: 3063
12
Mac IntelliJ IDE Python VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Oh, right. I forgot to mention that we are using WebLogic, but we're back a rev. on 8.1. It's in the documentation? Where? I did look for it, but so far without success.
 
reply
    Bookmark Topic Watch Topic
  • New Topic