Re: 5.2.3 Boolean Bugs?????
Re: 5.2.3 Boolean Bugs?????
- Subject: Re: 5.2.3 Boolean Bugs?????
- From: Jonathan Rochkind <email@hidden>
- Date: Thu, 18 Mar 2004 15:12:04 -0600
I've said it before, and I'll say it again now: My conclusion is do
NOT model boolean attributes at all. I think you're in for all sorts
of problems if you do. Between the JDBC Driver, the JDBCPlugIn, and
EOF's _own_ built-in stuff for data type coercion (specially the
wacky completely undocumented stuff around boolean values)----I think
you are a lot better off simply modeling your boolean-like columns as
an Integer, and providing custom cover methods in your Java class to
convert to boolean. Custom cover methods with a _different_ name than
your attribute, to make sure EOF doesn't sneak around in it's
completely undocumented way to do boolean conversion for you. EOF's
own boolean conversion has caused me all sorts of problems.
http://wodev.spearway.com/cgi-bin/WebObjects/WODev.woa/wa/Main?wikiPage=Weird52EOFBug
At 12:03 PM -0700 3/18/04, steve stout wrote:
Yes. And I think I'm the one that reported them. :)
I can't believe no one else has seen this before with OB.
.steve
On Mar 18, 2004, at 11:05 AM, Chuck Hill wrote:
I think the conversion between data from the database and objects
in Java is a function of the plug-in. This would make this bug a
database specific thing. I've heard of other similar problems with
OB in the past.
Chuck
On Mar 17, 2004, at 9:59 PM, Robert Walker wrote:
I am using MySQL and the DECIMAL data type. That could explain
the difference.
On Mar 17, 2004, at 3:30 PM, steve stout wrote:
What database are you using? I'm using OpenBase.
.steve
On Mar 17, 2004, at 12:19 PM, Robert Walker wrote:
Interesting, I'm not seeing this behavior at all in 5.2.3. I
have a BigDecimal (10, 2) and am using the formatter "0.##" and
all seems fine. Whole number display correctly as "3" and
decimals will correctly round to 2 digits like "3.15" for
example.
On Mar 17, 2004, at 12:50 PM, steve stout wrote:
Yes, setting the ValueType to 'B' works and takes care of the
ClassCastException, but the problem I'm having is that the
scale of the BigDecimal isn't being set correctly. So, for
example, if I have a whole number value like 3, the value
that's returned comes out as 3.000000000. The default behavior
of BigDecimal is to chop off those extra digits after the
decimal. So somewhere in the instantiation of the BigDecimal,
setScale() is being called. Unfortunately, just setting the
scale in EOModeler doesn't work.
In 5.2.2, the solution was to set the ValueType to 'd', which
would create a BigDecimal, but the scale would be set properly.
This doesn't work in 5.2.3.
The reason why this is a problem is mainly for display
purposes. If I have a value that uses a formatter of "0.##"
because I _sometimes_ need to show the digits after the
decimal, it will now always show the zeros. In 5.2.2, it would
show "3" with a formatter of "0.##", but now that the scale is
being set too high, it always shows "3.00"
I can't remember, but I think that this also causes a problem
with comparing 2 BigDecimals. Because 3 != 3.000000000. I'll
have to double check on this though.
.steve
On Mar 17, 2004, at 9:02 AM, Robert Walker wrote:
This behavior is again confirmed. I installed the 5.2.3
update on my test development box and found this problem.
This appears [SO FAR] to be a bug FIX not a new bug. I did
not have the "B" value type set for my BigDecimal's in my
model. WO 5.2.3 now throws the class cast exception, as it
probably should have in 5.2.2. I could be wrong about this.
However, adding the correct ValueType ("B" in this case) fixes
the problem.
On Mar 17, 2004, at 8:40 AM, Travis Britt wrote:
On Mar 17, 2004, at 8:09 AM, Anders Peterson wrote:
I upgraded to WO 5.2.3 today on my Mac OS x 10.3.3
development machine.
I get ClassCastExceptions exceptions for (at least some)
BigDecimals. I don't have Booleans.
I also see this behavior, after upgrading dev to 5.2.3.
I've got an EO with an attribute modeled as NSDecimalNumber,
which maps to a FLOAT column in the DB. The code output by
EOModeler casts this attribute to a BigDecimal, which throws
the exception. Worked in 5.2.2.
tb
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
--
Sincerely,
Robert Walker
Programmer
Bennett Technology Group
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
--
Sincerely,
Robert Walker
Programmer
Bennett Technology Group
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
///---------------------------------------
steve stout
web coordinator
arizona student unions
52o.626.o1o9
http://www.union.arizona.edu
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
--
Sincerely,
Robert Walker
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
///---------------------------------------
steve stout
web coordinator
arizona student unions
52o.626.o1o9
http://www.union.arizona.edu
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.