db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject Re: Inheritence question
Date Tue, 21 Jun 2005 07:23:00 GMT




I am happy to hear this. Of course we are interested in these patches.
I would guess that the "protected" part of the patch is not problematic to
implement, and also the foreign key part should be ok.
In my opinion, it is a good idea to put the base packages into a
subdirectory. However, I am not so sure about backwards compatibility
there. Probably one would want to make this configurable (preferably via a
configurable package suffix)

I do not know how many files you have patched and against which version. If
there are not too many changed files, I would appreciate it if you create
an issue in scarab and append the complete files there (please do not diff
if possible, some velocity templates have changed a bit in the meantime in
cvs). If you prefer it, you can also mail the files directly to me.

     Thomas


Jonathan Purvis <jon@reeltwo.com> schrieb am 20.06.2005 22:45:02:

> Thomas Fischer wrote:
> > I am afraid there is nothing to achieve this out of the box. There is
no
> > way Torque can know  which column belongs to which class from the
> > schema.xml (and I do not know a way how this could be specified).
> > Of course you can subclass the setters of the unwanted column and throw
an
> > exception, making sure that they can never be called. But this is not
the
> > optimal solution, it would be better if they would not be visible.
> > One way to achieve this might be to change the templates such that for
> > inheritance base classes, the getters and setters are made protected
and
> > you make just the wanted columns public in the subclass.
>
> As luck would have it, we have patched Torque to do this.  We added a
> "protected" attribute to the column element, so that when
> protected="true" is defined, the getter and setter for the column is
> protected and can be defined only in the subclass that needs it.
>
> We have also patched Torque to put the base classes in a separate
> package (to ease not checking them into a version control system and not
> subjecting them to style checks) and allow null foreign keys by
> supporting "int" in one table and "Integer" in another.
>
> Are you interested in adding these patches to Torque?
>
>
> Regards,
>
>    Jon
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-dev-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org


Mime
View raw message