Open GoogleCodeExporter opened 9 years ago
Original comment by bniemyjski
on 18 Oct 2010 at 6:52
Thanks for contributing this. I'm looking into this now.
Original comment by bniemyjski
on 9 Mar 2012 at 1:35
Original comment by bniemyjski
on 9 Mar 2012 at 1:57
This issue was updated by revision r2534.
Added GetByCriteria methods to the Lists.
Original comment by bniemyjski
on 12 Mar 2012 at 5:17
Hello,
Thanks a bunch for committing your changes. Would it be possible to expand on
the following issues (E.G., why you made the changes and any issues you ran
into) #2,3,4,5,6,7,8,9,10
It would be a very huge help, if you could update your templates to the latest
nightly build of CSLA as we've changed quite a bit to ensure support for views
and commands. Also if you could include each change over a few separate issues
it would allow me to review these and talk about these issues in much greater
detail in a shorter amount of time, allowing me to contribute these to core.
Original comment by bniemyjski
on 12 Mar 2012 at 5:22
Hello,
Thanks a bunch for committing your changes. Would it be possible to expand on
the following issues (E.G., why you made the changes and any issues you ran
into) #2,3,4,5,6,7,8,9,10
It would be a very huge help, if you could update your templates to the latest
nightly build of CSLA as we've changed quite a bit to ensure support for views
and commands. Also if you could include each change over a few separate issues
it would allow me to review these and talk about these issues in much greater
detail in a shorter amount of time, allowing me to contribute these to core.
Original comment by bniemyjski
on 24 Apr 2012 at 1:36
Hi Blake,
I've updated the changes to the current templates (R2632). This was no small
task as there have been a lot of updates since I posted this 18 months ago. I
haven't had time to test these thoroughly but they do produce working code for
an existing project I based the original change on. Note only the C# templates
have been updated.
I'm tied up on urgent project work so haven't got time to split these issues
out. To answer the other Q's:
#2 - Search criteria required to generate search filters. Similar to select but
all text fields (varchar, char etc) use SQL Like in where clause. Also if
search requires custom fields (i.e. filter by fields not returned table such as
parent fields, computed fields, custom logic etc) these can be added to the
search procedure without impacting standard CRUD procs. I find complex search
logic is best implemented in database procedures and separating the search from
CRUD works well.
#3 – When using stored procedures for all data access (particularly when
table level permission cannot be granted for security reasons) the Exists
method needs to use a stored procedure and not SQL. The updated template
ensures all Exists commands use a new Exists stored procedure which is based on
the Select but with optimised SQL
#4 – Update Store Procedure templates for above. Note also changed
implementation for GUID PK’s. These are now generated in the object and not
returned from the DB.
#5 – New objects need unique hash keys derived from primary key values. For
idents I use an incremental negative number until the object is saved. This
ensures all new objects in memory of unique within their type. Guid PK’s are
also initialised with a new GUID and thus do not need to be returned from the
SP’s
6# - Performance on large lists requires typed LoadProperty to bypass internal
reflection methods
7# as above
8# XML SQL type mapped to System.String.
9# Parent references need to be refreshed if related foreign key changed. I
used a hashset to keep a list of parents that need to be refreshed when the
foreign key property is updated.
10# Other changes include: Cache support to reduce database hits and improve
performance for enumerations; bug fix to correctly include search criteria on
unique indexes when field names have been stripped of underscores; bug fix for
parent and child property names when more than one foreign key relationship
exists between the same tables (also changed parent member names back to
"TableName"Member instead of “TableName”s), Bug fix for child insert/update
where multiple FK’s to same parent generates duplicate method signatures
(look for AssociationTypeComparer and BuildCommandParameters – updated to
stop parent values being updated onto child when parent relationship cannot be
determined due to multiple of same type. Need a better solution); Bug fix to
return and update SQL computed fields after insert and update
I suggest you run a compare between the templates to view all changes.
Thanks for following up on this. I'd like to see these changes back in the core
so I don't have to apply updates to each release.
Original comment by comi...@gmail.com
on 30 Apr 2012 at 11:07
Attachments:
Hello,
Thank you so much for taking the time to submit the updated patch and respond
to my questions. I'll look over these changes and see what I can do to get them
into core. I'll keep updating this issue as I have more time / changes.
Original comment by bniemyjski
on 30 Apr 2012 at 2:27
Original comment by bniemyjski
on 24 May 2012 at 3:11
Original issue reported on code.google.com by
comi...@gmail.com
on 14 Oct 2010 at 9:22Attachments: