Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

boolean mapping  RSS feed

 
mohit joshi
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
weblogic server maps boolean fields in Entity Beans to varchar2(1) field in database as '0' and '1'. Are these mappings part of EJB specifications or are these addons provided by the servers?
If they are mentioned in ejb specifications , I would like to know where
 
George Brown
Ranch Hand
Posts: 919
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, I don't think that is part of the EJB spec.
What JDBC driver / database / OR mapping tool are you using?
 
mohit joshi
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using weblogic with oracle driver and oracle db.
I am now converting my boolean fields in Entity beans to Strings. I will try to see if the getter / setter methods can still return boolean arguments otherwise i will have to do major changes in my jsp codes
[This message has been edited by mohit joshi (edited November 10, 2000).]
 
George Brown
Ranch Hand
Posts: 919
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why not convert the boolean values to integer values? that way, you can use two static final attributes, perhaps intTrue and intFalse to represent a true and false value for an integer (maybe the values 1 and 0 respectively). I think there would be less overhead than using Strings that way, and there would be a direct mapping for an integer to your database.
I hope that helps.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!