On Oct 15, 2007, at 5:21 PM, Adam Heath wrote:
David E Jones wrote:On Oct 15, 2007, at 4:48 PM, Adam Heath wrote:David E Jones wrote:Adam,It's pretty clear you like this idea and don't want to back down, so I'mnot going to push back.It's been a problem for me(and Ean, my coworker) since we started usingOfBiz. It's not something new. It's made our job *more* difficult.Could you be more specific? What has made your job more difficult?MyEvent.groovy: == What I currently do: def value = delegator.findByPrimaryKeyCache("EntityName", [fieldName: "fieldValue"]) if ("Y".equals(value.booleanField)) { // default false logic == == What I'd like to do: if (value.booleanField) { // default false logic ==
So what is making your job more difficult is having to do this:
if ("Y".equals(value.isSomething))
instead of this:
if (value.isSomething)
Is that right?
If you're looking for easy to understand this has been supported for
half a dozen years:
if (value.getBoolean(isSomething).booleanValue()) Or if Groovy is like bsh you can just do: if (value.getBoolean(isSomething))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.
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.
Whatever the case, again please be more specific about what you propose... I kind of feel like I'm spinning my wheels... ;)
-David
smime.p7s
Description: S/MIME cryptographic signature
