Hi all,

Although i doesn't contribute to the codebase yet, i would like to say that i totally agree with Adam. This is stupid to do checks on character where we can do simple checks on boolean. I didn't see the point in arguing all the night that it's better to do string comparison than boolean comparison. (and i'm not a beginner at programming)

Best regards,

Adam Heath a écrit :
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.




--
Cordialement,
Ludo - http://www.ubik-products.com
---
"L'amour pour principe et l'ordre pour base; le progres pour but" (A.Comte)

Reply via email to