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: Support for Primary Key using Composition instead of inheritance
Date Wed, 21 Feb 2007 21:30:18 GMT
You can tell Abator to not generate a seperate class for the primary key.
Specify a default model type of "flat" on your abator context.  This would
put all the fields in one class.

If you want to use composition instead of inheritance, then you'd need to
write your own JavaModelGenerator implementation.  There is some information
about how to do this in the abator documentation (see the section on
extending abator).

As far as specifying the primary keys in the config, there's no support for
this.  You can achieve the same effect by reusing the selectByExample method
- write specific selectByXXX methods that take the psuedo primary keys as
parameters.

Jeff Butler


On 2/21/07, bkbonner <brian.bonner@paraware.com> wrote:
>
>
> I would like to change how abator handles the mapping of files to use
> composition of the primary keys instead of inheritance.  Inheritance of
> the
> primary key seems a little awkward to me.
>
> Do you have any suggestions as to how what I would change to let abator
> include this new behavior?
>
> I'd also like to be able to specify the override the columns of the
> primary
> key in the abator config file for old broken models that don't have
> primary
> keys defined where the DBAs won't change the database to apply the primary
> key.
>
> Any suggestions here would be helpful, too.
>
> Thanks.
>
> Brian
> --
> View this message in context:
> http://www.nabble.com/Support-for-Primary-Key-using-Composition-instead-of-inheritance-tf3269344.html#a9089343
> Sent from the iBATIS - User - Java mailing list archive at Nabble.com.
>
>

Mime
View raw message