ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Bennett <mark.bennett.m...@gmail.com>
Subject Re: [ABATOR] override to a primitive creates generated code error
Date Thu, 12 Jan 2006 22:15:32 GMT
Hey Jeff,

The more I think about it, I suppose as long I have "NOT NULL" on my column
in the database then I shouldn't have to worry about null pointers when I
call booleanValue(). Also there have been cases where I've regretted using
int rather than Integer so perhaps I'll make the move to Boolean.

I like the "Example" pattern.  I think this could really cut down on my
methods. I have so may select*By* methods.  What really makes this thing
usable is the columnOveride tag.  I've tried autogenerating before but I end
up having to manually changing over half of it by hand to support my

Thanks, I think this will help me a lot.


On 1/12/06, Jeff Butler <jeffgbutler@gmail.com> wrote:
> Hi Mark,
> I must admit that I didn't consider the possibility of primitives in my
> initial design (because we don't use them in our applications), so it's not
> too surprising to me that there's an error.  I'll have to take a look at
> this a little further to figure out the best way to handle it overall - but
> it's obviously something that the tool should support.
> In the meantime, if you're not using the "by example" methods, you can
> turn them off by setting attributes on the <table> element in the XML
> configuration file - that will stop generation of the offending method.
> If you are using the "by example" methods, then perhaps using a "big B"
> Boolean would be an acceptable workaround until I get it fixed in Abator?
> BTW - I'm leaning towards the wrapper approach right now.
> Thanks for reporting this -
> Jeff Butler
> On 1/12/06, Mark Bennett <mark.bennett.mail@gmail.com> wrote:
> >
> > While using this great Abator tool, I tried using the column overide tag
> > to covert SHORTINT to boolean it works everywhere except for in the method
> > getExampleParams(...).   Here is the def:
> >
> >         <columnOverride column="FILETRANSFERFLAG"
> > property="fileTransferFlag" javaType="boolean"/>
> >
> > And the generate code creates an error on the last line:
> >
> >         case SupervisionDetailExample.EXAMPLE_GREATER_THAN:
> >             if (example.isCombineTypeOr()) {
> >                 parms.put("OR_FILETRANSFERFLAG_GT", "Y");
> >             } else {
> >                 parms.put ("AND_FILETRANSFERFLAG_GT", "Y");
> >             }
> >             parms.put("fileTransferFlag", example.getFileTransferFlag());
> > // Can't add primitive to Map
> >
> > Here it is trying put a primitive in a Map.  I could fix this manually
> > but my change will be lost when it gets run the next time.  Perhaps I am
> > doing something wrong but it seems that the last line of code either needs a
> > wrapper or just removed and leave it to the user to just use the string
> > fields as an indicator.
> >
> > Mark
> >

View raw message