Jeff-Lewis / codesmith

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

CSLA: Problem when Composite Primary Key includes a Foreign Key? #166

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Invoices has PK on one field, InvoiceLines has PK on 2 fields (one of the
fields includes the ID from the Invoices table). See attached for SQL
structure and resulting VS solution.

Entities.csp has Invoices as EditableRoot, and InvoiceLines as
EditableChildList and EditableChild. Criteria classes are created for both
as is true the DataAccessLayer.

The resulting relationship in the entities is one-to-one (i.e.
Invoice.InvoiceLine) when it is expected to be one-to-many (e.g.
Invoice.InvoiceLines collection).

If you remove the PK from InvoiceLines, the entity objects are created
correctly, but the DAL breaks.

Am I violating an assumption the templates are making, or is this a bug? I
hope the latter because I don't have control over the data structure.

Original issue reported on code.google.com by jprice5...@gmail.com on 15 Oct 2009 at 6:35

Attachments:

GoogleCodeExporter commented 9 years ago
Can you try the latest build?

Original comment by shannon....@gmail.com on 19 Oct 2009 at 4:26

GoogleCodeExporter commented 9 years ago
Yes, the most recent build (r1043) does address this issue.

Original comment by jprice5...@gmail.com on 19 Oct 2009 at 5:02

GoogleCodeExporter commented 9 years ago
Thanks for the update.

Original comment by bniemyjski on 19 Oct 2009 at 5:10

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 21 Jun 2010 at 8:08

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 15 Jul 2010 at 2:21