AnantLabs / codesmith

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

Child data access partial methods missing parameters #276

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.EditableChild.DataAccess.StoredProcedures.cst
2. Connections strings are not getting passed to the partial methods. These
are required to override child DAL logic.
3. OnMapped method also needs to pass "reader" parameter.

What is the expected output? What do you see instead?
This change might be applicable in other areas of the templates.
 #Region "Child data access partial methods"

    Partial Private Sub OnChildCreating(ByRef cancel As Boolean)
    End Sub
    Partial Private Sub OnChildCreated()
    End Sub
    Partial Private Sub OnChildFetching(ByVal connection As SqlConnection,
ByVal criteria As ConsultantCriteria, ByRef cancel As Boolean)
    End Sub
    Partial Private Sub OnChildFetched()
    End Sub
    Partial Private Sub OnMapping(ByVal reader As SafeDataReader, ByRef
cancel As Boolean)
    End Sub
    Partial Private Sub OnMapped()
    End Sub
    Partial Private Sub OnChildInserting(ByVal connection As SqlConnection,
ByRef cancel As Boolean)
    End Sub
    Partial Private Sub OnChildInserted()
    End Sub
    Partial Private Sub OnChildUpdating(ByVal connection As SqlConnection,
ByRef cancel As Boolean)
    End Sub
    Partial Private Sub OnChildUpdated()
    End Sub
    Partial Private Sub OnChildSelfDeleting(ByVal connection As
SqlConnection, ByRef cancel As Boolean)
    End Sub
    Partial Private Sub OnChildSelfDeleted()
    End Sub
    Partial Private Sub OnDeleting(ByVal connection As SqlConnection, ByVal
criteria As ConsultantCriteria, ByRef cancel As Boolean)
    End Sub
    Partial Private Sub OnDeleted()
    End Sub

    #End Region

What version of the product are you using?
r1439

Please provide any additional information below.
Please don't shoot the messenger.

Original issue reported on code.google.com by JenasysD...@gmail.com on 24 Feb 2010 at 6:15

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 24 Feb 2010 at 11:25

GoogleCodeExporter commented 9 years ago
Blake, these are the changes I made to the VB stored procedure codesmith 
templates to
resolve the issue for software project I'm working on.  I'm sure you know which
folders each of these need to goto. 
It covers ERL and DRL situations.  I've got compiled code and unit tests against
this.  DRL seems a much better choice for navigator screens over ERL at this 
stage of
the templates.  I haven't done a full regression test into petshop of the 
change but
I'm fairly confident I got the lot, based on the templates file design. 
I'm not sure about the effect on parameterize templates (AKA I'm sure they are
incorrect).
Hope this helps. :)

Original comment by JenasysD...@gmail.com on 25 Feb 2010 at 9:26

Attachments:

GoogleCodeExporter commented 9 years ago
Hello,

This has been fixed in revision 1463. I decided against including the 
connection 
because I think that it would be harder to follow and read. It could also 
introduce 
more bugs if someone overrides the partial and messes with the connection but 
doesn't 
cancel. If you don't agree with the changes, I think we should have a 
discussion 
about this on the forums :).

Thanks
-Blake Niemyjski

Original comment by bniemyjski on 27 Feb 2010 at 8:15

GoogleCodeExporter commented 9 years ago

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

GoogleCodeExporter commented 9 years ago

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