Re: EOModeler and boolean
Re: EOModeler and boolean
- Subject: Re: EOModeler and boolean
- From: "Daniele Corti" <email@hidden>
- Date: Mon, 23 Apr 2007 16:20:37 +0200
2007/4/23, WIESEN Bruno <email@hidden>:
Hello,
I recently added a column in my table, i defined it like this in
EOModeler :
value class = NSNumber
External Type = bool
mmm did you check the SQL when you syncronize the EOModel and the database? maybe it has setted an int
instead of a bool?
It worked in a test application but now in the good one, it
failed...I have a JDBCAdaptorException : wrong value for int ...
When i ty to set the boolean field with the set...method : i get a
classCastException
I've get that problem in the get value, when I migrate a boolean field from OpenBase to FrontBase, in the first relase i brutally manipulate the getMethod:
the attribute id "enabled":
public Boolean enabled()
{
if(storedValueForKey("enabled") instanceof Boolean)
return (Boolean) storedValueForKey("enabled");
return ((Integer)storedValueForKey("enabled")).intValue() == 1 ? true : false;
}
Any ideas to solve the problem ?
Thank you!
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (
This email sent to email@hidden
N.B. I DON'T know why, but when for SOME reasons (why my boss must require a complete restructure of the DB the day I'm deploying the app :-( ) I've recreate the model java file, I've tried to use it as Boolean and get no problems:
I mean EOModeler generates:
public Number enabled()
{
return (Number) storedValueForKey("enabled");
}
I've changed in :
public Boolean enabled()
{
return (Boolean) storedValueForKey("enabled");
}
and it works! o_0
--
Daniele Corti
AIM: S0CR4TE5
Messenger:
email@hidden
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden