-
1. Re: How to make primitive types accept null values in jbossc
iwadasn Jul 18, 2005 10:48 AM (in response to rakeshkamat)
Generally, you should use the wrapper types for this, such as Integer, for exactly this reason. Just rewrite your code to change....
int -> Integer
boolean -> Boolean
double -> Double
etc...
That will allow you the freedom to use/detect nulls. -
2. Re: How to make primitive types accept null values in jbossc
rakeshkamat Jul 19, 2005 8:07 AM (in response to rakeshkamat)Thanks iwasdasn,
I converted all ints to Integers, didn't have any doubles or booleans in the code.
Unfortunately the problem persists. Is there any change to be made to the jbosscmp-jdbc.xml file?
Appreciate ur help. -
3. Re: How to make primitive types accept null values in jbossc
iwadasn Jul 19, 2005 10:14 AM (in response to rakeshkamat)
Ah, there must be a setting for it....
There is a simple way to find these settings. Look at your jbosscmp-jdbc.xml file. If this was properly made (perhaps by XDoclet) then it should have a dtd. This DTD will give you a webpage, here's what the address should be...
http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_4_0.dtd
The parser uses the document at this location to verify your file, therefore, any options that are allowed in the file will be defined in this page.
Search this page for "null" and you should find what you're looking for. If you can't read a DTD, you should take a few minutes to learn the basics, but pretty much, you need to write something that looks like this...
<cmp-field>
<field-name>id</field-name>
<column-name>fid</column-name>
<not-null />
</cmp-field> -
4. Re: How to make primitive types accept null values in jbossc
rakeshkamat Jul 20, 2005 12:21 AM (in response to rakeshkamat)o i c...
well i am not using xdoclet.. my jbosscmp-jdbc.xml is manually created by me :(
could u kindly paste a sample jbosscmp-jdbc.xml for me...
Thanks for all ur help.
Thanks and Regards.