|
Home > Archive > Commerce Server General > April 2006 > Field names in database
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Field names in database
|
|
| Alejandro 2006-03-25, 11:39 am |
| I don't understand how are fields in database associated with commerce server
objects.
For example, po["saved_shipping_total"], I'd like to know what table and
column is. Where is that association stored? or is it hardcoded?
thanks
| |
| Jeff Lynch 2006-03-25, 11:39 am |
| Alejandro,
As with most .NET applications that access a database, the association
between the object's properties and their associated field in the database
tables is usually stored in the application's data access layer. In CS2002
many properties (especially any custom properties you create) are stored in
binary form and may not be in a specific database "field". You should
generally access these properties using the CS2002 base class libraries
(BCL) as shown in the CS2002 help file and not directly from the database.
--
Jeff Lynch
"Ramblings From A [Microsoft] Connected Universe"
http://codebetter.com/blogs/jeff.lynch
"Alejandro" <Alejandro@discussions.microsoft.com> wrote in message
news:7F1C9490-F75D-4AEC-AA22-5A2E2C4BB6AE@microsoft.com...
>I don't understand how are fields in database associated with commerce
>server
> objects.
> For example, po["saved_shipping_total"], I'd like to know what table and
> column is. Where is that association stored? or is it hardcoded?
> thanks
| |
| Ravi Shankar 2006-03-25, 11:39 am |
| Hi Alejandro,
Further to the note of caution stated by Jeff the linkage is as follows..
There are some common rules pertaining to key storage. Only the keys start
DO NOT start with an "_" are persisted. There should be a field in the table
which matches the key name 
Keys at PurchaseOrder level will be stored in the OrderGroup Table.
Keys at OrderForm level will be stored in the OrderFormHeader Table.
Keys at LineItem level will be stored in the OrderFormLineItems Table.
Keys in the Address collection will be stored in the OrderGroupAddresses
Table.
--
Ravi Shankar
"Alejandro" wrote:
> I don't understand how are fields in database associated with commerce server
> objects.
> For example, po["saved_shipping_total"], I'd like to know what table and
> column is. Where is that association stored? or is it hardcoded?
> thanks
| |
| Alejandro 2006-04-01, 2:39 pm |
| Thanks a lot!
I didn't understand that part:
> There are some common rules pertaining to key storage. Only the keys start
> DO NOT start with an "_" are persisted. There should be a field in the table
> which matches the key name 
particularly, "Only the keys start DO NOT " seems to be missing something?
"Ravi Shankar" wrote:
[vbcol=seagreen]
> Hi Alejandro,
>
> Further to the note of caution stated by Jeff the linkage is as follows..
>
> There are some common rules pertaining to key storage. Only the keys start
> DO NOT start with an "_" are persisted. There should be a field in the table
> which matches the key name 
>
> Keys at PurchaseOrder level will be stored in the OrderGroup Table.
> Keys at OrderForm level will be stored in the OrderFormHeader Table.
> Keys at LineItem level will be stored in the OrderFormLineItems Table.
> Keys in the Address collection will be stored in the OrderGroupAddresses
> Table.
>
> --
> Ravi Shankar
>
>
> "Alejandro" wrote:
>
| |
| Ravi Shankar 2006-04-01, 2:39 pm |
| Hi Alejandro,
Sorry about that.. did not notice that slip till you pointed it out.
What I'd wanted to state was that only those keys in object whose names do
not start with an "_" (underscore) are persisted. All the objects, basket,
purchase order, template are derived from the ordergroup class which, if you
examine is an implementation of the commerce server "dictionary" class. Most
commonly used keys on the ordergroup object have been strong-named as
properties in these objects which is why you can still bypass some of these
object properties by using the ".item(<key_name> )" notation.
The "Save" option uses the "DBStorage" class to persist these objects into
the underlying data stores. If you read the documentation pertaining to the
way DBStorage works, you'll find that it is a class that converts the
dictionary to the table. You'll find this bit about "_" there. You will also
then understand how to extend the underlying DB to store your own keys. 
--
Ravi Shankar
"Alejandro" wrote:
[vbcol=seagreen]
> Thanks a lot!
> I didn't understand that part:
>
>
> particularly, "Only the keys start DO NOT " seems to be missing something?
>
>
> "Ravi Shankar" wrote:
>
|
|
|
|
|