|
From: Seaman, S. <Slo...@pt...> - 2004-09-08 12:25:08
|
Wes,
I tried it both ways (boolean and java.lang.Boolean) and both times I got
the same error:
java.lang.ClassCastException
at
com.ptilabs.clinicalTrials.commons.jdo.bean.Regimen$$EnhancerByCGLIB$$8.getE
ndDateUnknown(<generated>)
at
com.ptilabs.clinicalTrials.main.ClinicalTrialEdit.setPage3(Unknown Source)
at com.ptilabs.clinicalTrials.main.ClinicalTrialEdit.execute(Unknown
Source)
Any help would be great...
Thanks!
--
Sloan
-----Original Message-----
From: Wes Biggs [mailto:we...@ca...]
Sent: Tuesday, September 07, 2004 3:54 PM
To: xor...@li...
Subject: Re: [Xorm-users] ClassCastException
Yes, try defining it as primitive boolean or object Boolean in the Java
interface.
It's dependent on how the JDBC driver treats the BIT type when
converting to Java objects though, so that may also get you a
ClassCastException.
If it doesn't work you might be able to define it as
int getEndDateUnknown()
and then write a wrapper function
boolean getEndDateUnknownBoolean() {
return (getEndDateUnknown() == 1);
}
I don't have an Oracle installation to play with to test this from here.
Let me know how it works; I can update the Oracle driver to be smarter
about this type of mapping.
Wes
Seaman, Sloan wrote:
> Wes,
>
> Yes I did try type="bit". But, just to make sure, do I then still
> have Boolean in the Interface? I.E. abstract Boolean
> getEndDateUnknown()?
>
> If so, I'll try it again (maybe I missed something)...
>
> --
> Sloan
>
> -----Original Message-----
> From: Wes Biggs [mailto:we...@ca...]
> Sent: Tuesday, September 07, 2004 2:29 PM
> To: 'xor...@li...'
> Subject: Re: [Xorm-users] ClassCastException
>
>
> Sloan,
>
> XORM expects the "type" attribute to be the SQL type -- have you tried
>
> <column name="END_DATE_UNKNOWN" type="bit" />
>
> ?
>
> Wes
>
> Seaman, Sloan wrote:
>
> > Anyone know of any issues with Oracle and XORM converting from a BIT
> > to a boolean?
> >
> > I have a BIT field in an oracle db and I have the field defined as
> > boolean in the database.xml file but I keep getting class cast
> > exceptions...
> >
> > I've tried:
> > <column name="END_DATE_UNKNOWN" type="boolean"/>
> > and
> > <column name="END_DATE_UNKNOWN" type="java.lang.Boolean"/>
> >
> > Only
> > <column name="END_DATE_UNKNOWN" type="java.lang.String"/>
> >
> > Seems to work even though the field in the db is a BIT.
> >
> > Any ideas?
> >
> > --
> > Sloan
> >
>
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by BEA Weblogic Workshop
> FREE Java Enterprise J2EE developer tools!
> Get your free copy of BEA WebLogic Workshop 8.1 today.
> http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
> <http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click>
> _______________________________________________
> Xorm-users mailing list
> Xor...@li...
> https://lists.sourceforge.net/lists/listinfo/xorm-users
>
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
Xorm-users mailing list
Xor...@li...
https://lists.sourceforge.net/lists/listinfo/xorm-users
|