ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: R: Abator factory extension - best practices
Date Tue, 28 Aug 2007 19:25:48 GMT
Regarding protected get/set methods...this would be simple to implement on
your own.  Write a class that subclasses the appropriate JavaModelGenerator
you are using, override the "generateClassParts" method, and then specify
this class in the Abator configuration as the java model generator.

If I were to implement this, I would likely do it as a property to the
JavaModelGenerator rather than a column by column override.  Seems to me
that most folks would want the visibility set the same for every member -
not needed on an individual basis.  Also, this wouldn't require any DTD
changes.  But, because these are not "real" domain objects, I think it's
kind of an unusual request.  Anyone else have comments about this?

Regarding the custom comment request, I have heard this request before.
What if we did some kind of "CommentGenerator" interface that could be
plugged in?

Jeff Butler


On 8/28/07, Fabio Collini <fcollini@omniagroup.it> wrote:
>
>  Hello Jeff,
>
> thank you for your reply. We're glad to hear that the way
> you suggest of using Abator is quite similar to what we were
> thinking about. The idea of having some factory came
> out from the need to generate pojos with properties (get and set)
> protected.
>
> We thought to achieve this with the following steps:
>
> 1) add a new attribute, visibility, to the xml element "columnoverride"
> 2) changing the DTD accordingly
> 3) extend the class ColumnOverride to add the new property
> 4) extend the AbatorConfigurationParser to handle
> columnoverride.visibility property
> 5) modify the bean generator to obtain bean with proptected getter/setter
>
> It's difficult to obtain this because there are explicit costructor
> invocation
> of the parser and of the ColumnOverride (for example inside the method
> AbatorConfigurationParser.parseColumnOverride).
> We thought that a factory for the parser and the ColumnOverride object
> would solve this problem and make the design
> more extendible. What do you think?
>
> Another question: is it possible to customize the behavior of the
> bean/dao/sqlmap generators
> so that you can specify your own comment to be inserted? A setComment
> method?
>
> Thank you
> Bye
>

Mime
View raw message