You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "Dickerson, Carleen (US SSA)" <ca...@baesystems.com> on 2009/03/16 18:36:31 UTC

Plugin to create custom domain object name

Hi all,

I'd like for iBATOR to create my domain objects based on their corresponding table name. But I'd also like to add the suffix "DTO" to the end of them. I know I can map this per table, but I was really hoping I could just customize one of the iBATOR plugins. Looking through the documentation though, I don't see a place for it. Any ideas?

Thanks.


Re: Plugin to create custom domain object name

Posted by Jeff Butler <je...@gmail.com>.
Please see here:

http://svn.apache.org/repos/asf/ibatis/trunk/java/tools/ibator/core/src/org/apache/ibatis/ibator/plugins/RenameExampleClassPlugin.java

This is an example of renaming the example classes.

You can easily write a similar plugin that will grab the calculated
name for the domain objects and add "DTO" - do it in the "initialized"
method.

Jeff Butler


On Mon, Mar 16, 2009 at 12:36 PM, Dickerson, Carleen (US SSA)
<ca...@baesystems.com> wrote:
> Hi all,
>
> I'd like for iBATOR to create my domain objects based on their corresponding
> table name. But I'd also like to add the suffix "DTO" to the end of them. I
> know I can map this per table, but I was really hoping I could just
> customize one of the iBATOR plugins. Looking through the documentation
> though, I don't see a place for it. Any ideas?
>
> Thanks.
>