codesmithtools / Templates

CodeSmith Generator Templates
http://www.codesmithtools.com/product/generator
54 stars 35 forks source link

Many-To-Many and One-To-Many relations to same table is causing variables naming errors #291

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Generate PLINQO templates for a large production database that contains a
table that is related to at the same other table in one Many-To-Many
relationship and one One-To-Many relationship.

For example 
User -> TaskHour[OTM] -> TaskHour 
User -> TaskHourInvoiced[MTM] -> TaskHour

Explanation: 
An user has multiple logged hours.
The user also has some of those hours invoiced in a particular invoice.

2.Compiling and getting errors 
http://screencast.com/t/NWYzY2U0ND
Error   101 The type 'TasksManagement.Business.User' already contains a
definition for '_taskHourList'  

What is the expected output? What do you see instead?
No errors.

What version of the product are you using?
CodeSmith 5.2.0.10552
PLINQO 4.0 (that cames embedded with CodeSmith)

Please provide any additional information below.
Detect such situation and rename the property and valriables in a
predictible way, or if not add a number at the end i.e _taskHourList1

Allow the user to edit this values to a custom friendly name.

Original issue reported on code.google.com by alonec...@gmail.com on 27 Feb 2010 at 1:31

GoogleCodeExporter commented 9 years ago
Can you send a schema to support@codesmithtools.com so we can investigate this 
issue.

Original comment by shannon....@gmail.com on 2 Mar 2010 at 5:03

GoogleCodeExporter commented 9 years ago
Hello,

I have been able to reproduce this issue.

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 2 Mar 2010 at 9:05

GoogleCodeExporter commented 9 years ago
Fixed the duplicate many to many names.

Original comment by paul.wel...@gmail.com on 3 Mar 2010 at 3:09

GoogleCodeExporter commented 9 years ago

Original comment by paul.wel...@gmail.com on 10 Mar 2010 at 11:27