David E Jones wrote:
> Is that what you are looking for? If so I apologize as I was confused. I
> thought you were proposing that we force this throughout. The option to
> treat the Y/N values as booleans has been around for a long time.
Wasn't looking for anything. I am aware of the methods on GenericEntity.
> If you're proposing that we change the get method to behave like the
> getBoolean method by default, then I'd be pretty against that as it
> would break a LOT code/etc, much of which is not compiled.
I am proposing that, but it might wait for an extended period. Code
coverage will help with it. And my grep foo is rather good and finding
these things.
I'm willing to do this in a git/svk branch, if there is worry about
breakage.
> Whatever the case, again please be more specific about what you
> propose... I kind of feel like I'm spinning my wheels... ;)
Ok, let's do this another way:
If I want an Integer from an entity, I do:
(Integer) value.get("integerField");
If I want a Timestamp from an entity, I do:
(java.sql.Timestamp) value.get("timestampField");
If I want a BigDecimal from an entity, I do:
(BigDecimal) value.get("bigDecimalField");
If I want a Blob from an entity, I do:
(Blob) value.get("blobField");
If I want a Boolean from an entity, I do:
value.getBoolean("booleanField");
or:
"Y".equals(value.get("booleanField"))
Note the pattern.