You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Daniel Rall <dl...@finemaltcoding.com> on 2001/09/06 18:52:04 UTC

Re: [PATCH] Torque table and column naming

FWIW, I added code in Turbine 3 for this sort thing.

Daniel Rall <dl...@finemaltcoding.com> writes:

> Byron Foster <bf...@base2.cc> writes:
> 
> > Kurt Schrader wrote:
> > 
> > > On Saturday, August 11, 2001, at 01:37 PM, Daniel Rall wrote:
> > >
> > >> So I finally reviewed this patch.  A more flexible implementation
> > >> would involve a one-method name conversion interface to be implemented
> > >> by the application programmer.  I would involve setting a
> > >> "nameConversion" attribute on the schema, table, or column one would
> > >> like their name conversion implementation to be applied against.  The
> > >> nameConversion attribute would be overridden if the javaName attribute
> > >> was set for any fields.  Some simplicitly is lost with my proposal
> > >> (compared against the patch below).  Thoughts on this?
> > >
> > >
> > > I would prefer it this way also, as long as there is a default
> > > implementation
> > 
> > > that would be executed if the property wasn't specified.  I've never
> > > found a need to deviate from the default mapping and this is something
> > > that I don't want have to worry about.
> > >
> > >> If it's not liked as much as the patch below, I'll check in with
> > >> changes to the names of the alogorithm types supplied by Byron and a
> > >> modification to the DTD to take this into account.
> > >
> > >
> > > I would be -0 to Byron's patch as I don't want to see this happening
> > > whenever someone comes up with a new way to change the
> > > capitalization of columns.
> > >
> > Actually the patch preserves the current default behavior.  If the
> > user does not specify a method for conversion then torque will apply
> > the current algorithm.
> 
> Yes, it does.
> 
> > I think given the current trend such as   "javaName" and "basePeer"
> > attributes it would be appropriate to add a "nameConversion" attribute
> > to the database schema.  I would be willing to do this if it is the
> > consensus.
> 
> I would prefer this (I hope you don't feel jerked-around :).  Unless
> someone else speaks up soon, let's go with this, since as you point
> out it's much like the existing attributes.

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


Re: [PATCH] java naming change and docs

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Byron Foster <bf...@base2.cc> writes:

> Daniel Rall wrote:
>
>>Hi Byron, finally applied your javaNamingMethod patch.  I went ahead
>>and applied your xdoc patch as well, as Jason will be backporting
>>standalone Torque changes to the Turbine 2.x module.
>>
> Cool Thank!   I was curious why the docs are in turbine and not with
> torque.  Are there plans to migrate these docs over to
> jakarata-turbine-torque?  Thanks Again,

There is also a version of Torque in the old Turbine 2.x repository.
There are plans to migrate the documentation after the API for 3.x is
finalized.

                                Daniel

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


Re: [PATCH] java naming change and docs

Posted by Byron Foster <bf...@base2.cc>.
Daniel Rall wrote:

>Hi Byron, finally applied your javaNamingMethod patch.  I went ahead
>and applied your xdoc patch as well, as Jason will be backporting
>standalone Torque changes to the Turbine 2.x module.
>
>
Cool Thank!   I was curious why the docs are in turbine and not with 
torque.  Are there plans to migrate these docs over to 
jakarata-turbine-torque?  

Thanks Again,
Byron



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


Re: [PATCH] java naming change and docs

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Hi Byron, finally applied your javaNamingMethod patch.  I went ahead
and applied your xdoc patch as well, as Jason will be backporting
standalone Torque changes to the Turbine 2.x module.

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


[PATCH] java naming change and docs

Posted by Byron Foster <bf...@base2.cc>.
Daniel Rall wrote:

>"Byron Foster" <bf...@base2.cc> writes:
>
>
>You're right -- I misread the diff.
>
>>for the attribute name that sounds fine, I will submit a patch. So the
>>following names would be changed to:
>>
>>defaultConversionMethod -> defaultJavaNamingMethod
>>nameConversion -> javaNamingMethod (for column and table elements)
>>
>
>Yes, I think those names (or ones like them) are more indicative of
>what the attributes are for.
>
>>BTW,  I was not sure if the dtd was the correct place to put the docs for
>>the different naming methods.  Are there plans to add this type of
>>documentation to the dtd? the xdocs? both? regardless I can add some
>>additional documentation.
>>
>
>IMHO, putting documentation in the DTD is just fine.  Examples and
>usage instructions should be placed in the xdocs directory,
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: turbine-dev-unsubscribe@jakarta.apache.org
>For additional commands, e-mail: turbine-dev-help@jakarta.apache.org
>
Here are two patches.  
 
namingpatch.txt -> jakarta-turbine-torque directory
    This patch makes the above name changes to javaNamingMethod exactly 
as described.

docspatch.txt -> jakarta-turbine-2 directory
     This patch adds documentation to torque-schema-ref.xml describing 
the new javaNamingMethod attributes.

Thanks,
Byron

 


 


Re: [PATCH] New Patch for java naming

Posted by Daniel Rall <dl...@finemaltcoding.com>.
"Byron Foster" <bf...@base2.cc> writes:

> > Byron Foster <by...@yahoo.com> writes:
> > 
> >> Daniel Rall wrote:
> >> 
> >> >FWIW, I added code in Turbine 3 for this sort thing.
> >> >
> >> >
> >> 
> >> Hello,  Here is a new patch that implements the java naming scheme
> >> through attributes in the database schema that works with the new code
> >> that you added.  the <database> element now has a new attribute
> >> "defaultNameConversion" that may be either "underscore", "javaname",
> >> or "nochange".  The description of these are in the DTD.   Also the
> >> <table> and <column> elements have an optional attribute
> >> "nameConversion" that may also be one of the above.   Without any
> >> method specification the behavior of the name conversion is as it was
> >> before.
> > 
> > Commited, thanks Byron.  Would you explain the addition of the
> > nameConversion attribute to the id-method-parameter element?  Also,
> > since this change is Java-specific (I think), IMO an attribute name
> > which includes the text "java" for the database element's default Java
> > naming scheme would be more descriptive than defaultConversionMethod
> > (which is rather generic).  How about defaultJavaNamingMethod (or
> >something like that)?
> 
> Hello, Thanks for the commit.  Hmm, there shouldn't be a nameConversion
> attribute for the id-method-parameter, only for the column and table
> elements, and the latest cvs version of the dtd is consistent with this. I
> think looking at the patch may be misleading?

You're right -- I misread the diff.

> for the attribute name that sounds fine, I will submit a patch. So the
> following names would be changed to:
> 
> defaultConversionMethod -> defaultJavaNamingMethod
> nameConversion -> javaNamingMethod (for column and table elements)

Yes, I think those names (or ones like them) are more indicative of
what the attributes are for.

> BTW,  I was not sure if the dtd was the correct place to put the docs for
> the different naming methods.  Are there plans to add this type of
> documentation to the dtd? the xdocs? both? regardless I can add some
> additional documentation.

IMHO, putting documentation in the DTD is just fine.  Examples and
usage instructions should be placed in the xdocs directory,

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


Re: [PATCH] New Patch for java naming

Posted by Byron Foster <bf...@base2.cc>.
> Byron Foster <by...@yahoo.com> writes:
> 
>> Daniel Rall wrote:
>> 
>> >FWIW, I added code in Turbine 3 for this sort thing.
>> >
>> >
>> 
>> Hello,  Here is a new patch that implements the java naming scheme
>> through attributes in the database schema that works with the new code
>> that you added.  the <database> element now has a new attribute
>> "defaultNameConversion" that may be either "underscore", "javaname",
>> or "nochange".  The description of these are in the DTD.   Also the
>> <table> and <column> elements have an optional attribute
>> "nameConversion" that may also be one of the above.   Without any
>> method specification the behavior of the name conversion is as it was
>> before.
> 
> Commited, thanks Byron.  Would you explain the addition of the
> nameConversion attribute to the id-method-parameter element?  Also,
> since this change is Java-specific (I think), IMO an attribute name
> which includes the text "java" for the database element's default Java
> naming scheme would be more descriptive than defaultConversionMethod
> (which is rather generic).  How about defaultJavaNamingMethod (or
>something like that)?
> 
> 

Hello, Thanks for the commit.  Hmm, there shouldn't be a nameConversion
attribute for the id-method-parameter, only for the column and table
elements, and the latest cvs version of the dtd is consistent with this. I
think looking at the patch may be misleading?

for the attribute name that sounds fine, I will submit a patch. So the
following names would be changed to:

defaultConversionMethod -> defaultJavaNamingMethod
nameConversion -> javaNamingMethod (for column and table elements)

BTW,  I was not sure if the dtd was the correct place to put the docs for
the different naming methods.  Are there plans to add this type of
documentation to the dtd? the xdocs? both? regardless I can add some
additional documentation.

Thanks,
Byron




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


Re: [PATCH] New Patch for java naming

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Byron Foster <by...@yahoo.com> writes:

> Daniel Rall wrote:
> 
> >FWIW, I added code in Turbine 3 for this sort thing.
> >
> >
> 
> Hello,  Here is a new patch that implements the java naming scheme
> through attributes in the database schema that works with the new code
> that you added.  the <database> element now has a new attribute
> "defaultNameConversion" that may be either "underscore", "javaname",
> or "nochange".  The description of these are in the DTD.   Also the
> <table> and <column> elements have an optional attribute
> "nameConversion" that may also be one of the above.   Without any
> method specification the behavior of the name conversion is as it was
> before.

Commited, thanks Byron.  Would you explain the addition of the
nameConversion attribute to the id-method-parameter element?  Also,
since this change is Java-specific (I think), IMO an attribute name
which includes the text "java" for the database element's default Java
naming scheme would be more descriptive than defaultConversionMethod
(which is rather generic).  How about defaultJavaNamingMethod (or
something like that)?


                                Daniel

p.s. 4 character indent in the future, please
(http://jakarta.apache.org/turbine/common/code-standards.html).

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


[PATCH] New Patch for java naming

Posted by Byron Foster <by...@yahoo.com>.
Daniel Rall wrote:

>FWIW, I added code in Turbine 3 for this sort thing.
>
>

Hello,  Here is a new patch that implements the java naming scheme 
through attributes in the database schema that works with the new code 
that you added.  

the <database> element now has a new attribute "defaultNameConversion" 
that may be either "underscore", "javaname", or "nochange".  The 
description of these are in the DTD.   Also the <table> and <column> 
elements have an optional attribute "nameConversion" that may also be 
one of the above.   Without any method specification the behavior of the 
name conversion is as it was before.


Thanks,
Byron