From c004bbdf4f0e824e5ccbaef8f98ca4a3d44d3b49 Mon Sep 17 00:00:00 2001 From: wei <> Date: Fri, 14 Jul 2006 06:46:31 +0000 Subject: Changed SQLMap manual into a prado app. --- .../protected/pages/Manual/CompositeKeys.page | 53 ++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 demos/sqlmap-docs/protected/pages/Manual/CompositeKeys.page (limited to 'demos/sqlmap-docs/protected/pages/Manual/CompositeKeys.page') diff --git a/demos/sqlmap-docs/protected/pages/Manual/CompositeKeys.page b/demos/sqlmap-docs/protected/pages/Manual/CompositeKeys.page new file mode 100644 index 00000000..6e33c6cd --- /dev/null +++ b/demos/sqlmap-docs/protected/pages/Manual/CompositeKeys.page @@ -0,0 +1,53 @@ + + +

Composite Keys or Multiple Complex Parameters Properties

+

You might have noticed that in the above examples there is only a single key +being used as specified in the resultMap by the column attribute. +This would suggest that only a single column can be associated to a related +mapped statement. However, there is an alternate syntax that allows multiple +columns to be passed to the related mapped statement. This comes in handy for +situations where a composite key relationship exists, or even if you simply +want to use a parameter of some name other than #value#. The alternate +syntax for the column attribute is simply param1=column1, param2=column2, ... , +paramN=columnN. Consider the example below where the PAYMENT table +is keyed by both Customer ID and Order ID:

+ + + + + + ... + + + + + select * from PAYMENT + where PAY_ORD_ID = #itemId# + and PAY_CST_ID = #custId# + + + +

Optionally you can just specify the column names as long as they're in the +same order as the parameters. For example:

+ +{ORD_ID, ORD_CST_ID} + + +
Important! +

Currently the SQLMap DataMapper framework does not automatically resolve +circular relationships. Be aware of this when implementing parent/child +relationships (trees). An easy work around is to simply define a second result +map for one of the cases that does not load the parent object (or vice versa), +or use a join as described in the "N+1 avoidance" solutions.

+
+ +
Info: +Result Map names are always local to the Data Map definition file that they +are defined in. You can refer to a Result Map in another Data Map definition +file by prefixing the name of the Result Map with the namespace of the SqlMap +set in the <sqlMap> root element. +
+ + +
\ No newline at end of file -- cgit v1.2.3