AnantLabs / codesmith

Automatically exported from code.google.com/p/codesmith
1 stars 0 forks source link

CSLA TEMPLATES - Failing to exclude table that is referenced by Parent and Child #613

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Create database with Category, SubCategory and Staff tables.  The 
SubCategory table contains a foreign key to Category.  Both the Category and 
SubCategory tables contain a foreign to Staff.
2. Use QuickStart to generate soltion.
3. Add ^dbo.Staff to ignore expressions.  It is important that I do not 
generate the staff table
4. Configure the codesmith output to generate EditableRoot for Category, 
EditableChild and EditableChildList for SubCategory.
5. Staff insists on appearing as an EditableChild despite my repeated attempts 
to remove it.

What is the expected output? What do you see instead?
I need to suppress the generation of the Staff entities.

The functionality of Codesmith automatically adding related tables is 
undoubtedly useful, but I really want an option to disable this when I hit a 
problem like this.  Let me handle the pain of remembering to add EditableChild 
entities when I add an EditableChildList.

I have tried to download v6 to see if this would help but the trial key is no 
longer working.

What version of the product are you using?
Professional 5.3.4 Release 12823

Please provide any additional information below.
I have attached two zips.  Problem 2 relates to this ticket.  [Problem 1 
relates to seperate ticket that I raised couple of mins ago but forgot to 
attach]

Original issue reported on code.google.com by ianmcdid...@gmail.com on 25 Nov 2011 at 10:36

Attachments:

GoogleCodeExporter commented 9 years ago
Hello,

Thank you so much for the steps and samples. I've been able to reproduce this 
behavior where the tables are added back for generation. I'll be working on the 
CSLA templates as soon as Generator 6.0 is released and will make sure this is 
fixed in a nightly. 

As a short term work around, please open the entities.csp and remove the 
following lines:

      <table>
        <owner>dbo</owner>
        <name>Staff</name>
      </table>

This will ensure that the Staff related BO's are not generated.

Original comment by bniemyjski on 28 Nov 2011 at 3:00

GoogleCodeExporter commented 9 years ago
References case 04033597 and 
http://community.codesmithtools.com/Template_Frameworks/f/66/p/12374/47790.aspx#
47790

Original comment by bniemyjski on 6 Dec 2011 at 11:08

GoogleCodeExporter commented 9 years ago
"One other aspect of this bug may be that you are not checking if the sub table 
has a primary key before putting it in the list of "lists" to generate. 
I noticed this when I generated after reading the comments in the issue.  It 
looks like the first pass through does not generate for tables without PK's but 
when generating the "Lists" it doesn't look like the same check is made. "

Original comment by bniemyjski on 8 Dec 2011 at 6:19

GoogleCodeExporter commented 9 years ago
Hello,

This has 100% been fixed in revision 2505 and requires Generator 6.0.3.

Original comment by bniemyjski on 8 Mar 2012 at 7:42