Well I
agree about the tablenames & field names, but in our case we have >500k
lines of legecy code that I don't want to change if I change the field
name.
I'm
rather new to middlegen and didn't even know there was a DbNameConverter
class. I'll take a look at that thing.
thx
ed
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 19, 2003 9:11 AM
To: [EMAIL PROTECTED]
Subject: Re: [Middlegen-user] Generation errors
One big problem I have w/ DbNameConverter is it seems to only be documented in the source code. For example, the only way I even knew that I could get Middlegen to use our own DbNameConverter class is spotting the comment that explained this by accident while grepping the code looking for some token.
It'd be nice if it were documented on the site. If someone could point me at the ml discussions (date, etc) where using it in the manner you're discussing (to avoid conflicts between table names and field names in other tables), I'd even consider doing the work to make the documentation --if it's appropriate given the refactoring that's occurring now (is DbNameConverter surviving the refactoring?). We're using our own DbNameConverter here but I had no idea people were using it to avoid conflicts like this -- we had similar conflicts and we just resolved them at the DB level by changing the field names (which is reasonable anyway, I think; I don't think it's a good idea from a modeling standpoint to have a field called Patient and a table called Patients, for example, if there is no relationship being expressed -- why not have patient_name or something similar in the RX table).
Personally, I think that DbNameConverter in the middlegen tree is a little too fancy -- it makes way too many assumptions about what's "right."
Dave
Aslak Helles�y <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]06/19/2003 03:25 AM
Please respond to middlegen-user
To: [EMAIL PROTECTED]
cc:
Subject: Re: [Middlegen-user] Generation errors
Eivind Waaler wrote:
>Log your bugs in Jira:
>
>
This is not a bug I think. It can be solved by using a different
DbNameConverter. Search the code and docs and archives. There should be
an example somewhere.
Aslak
>http://jira.codehaus.org/secure/BrowseProject.jspa?id=10110
>
>.eivind
>
>On Wed, 18 Jun 2003, Ed Ross wrote:
>
>
>
>>When a table name is the same as the primary key column name, the templates
>>generate multiple errors
>>
>>There is an attribute that can be set in the build.xml (singlualr='xxx'
>>plural='xxxs' ) but these names are never used.
>>
>>here is the example -
>>
>>I have a table named patients (yes plural, but that's the way it is)
>>I have a table named rxs (perscriptions)
>>there is a fk relationship (one to many) between patients and rx
>>the code in the RxBean gets a bit confused - it generates a
>>
>>public abstract java.lang.Integer getPatient();
>>
>>and also generates
>>
>>public abstract techrx.interfaces.PatientLocal getPatient();
>>
>>
>>
>>The first one is used to return the patient ID that is part of the Rx
>>
>>The secon one is used to return the patient object found by the fk
>>
>>I tried to change the build.xml to rename the singlular form of patiens to
>>"indvidualPatinet", but the generator just ignored this. Any quick way to
>>fix this??
>>
>>
>>
>>This E-mail message is for the sole use of the intended recipient(s) and may
>>contain confidential and privileged information. Any unauthorized review,
>>use, disclosure or distribution is prohibited. If you are not the intended
>>recipient, please contact the sender by reply E-mail, and destroy all copies
>>of the original message.
>>
>>
>>
>
>
>
>-------------------------------------------------------
>This SF.Net email is sponsored by: INetU
>Attention Web Developers & Consultants: Become An INetU Hosting Partner.
>Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
>INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
>_______________________________________________
>middlegen-user mailing list
>[EMAIL PROTECTED]
>https://lists.sourceforge.net/lists/listinfo/middlegen-user
>
>
>
>
-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
middlegen-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/middlegen-user
This E-mail message is for the sole use of the intended recipient(s) and may contain confidential and privileged information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply E-mail, and destroy all copies of the original message.
