Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
saveRecord Behaviour Understanding Problem
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Mark  
View profile  
 More options Apr 23 2011, 6:22 am
From: Mark <m...@smoo.de>
Date: Sat, 23 Apr 2011 03:22:38 -0700 (PDT)
Local: Sat, Apr 23 2011 6:22 am
Subject: saveRecord Behaviour Understanding Problem
Hi, I just started using DataMgr and have a little problem with
understanding what saveRecord does. I tought that if I do not pass a
value for the primary key it automatically inserts a now record - but
what it does is updating the record for the primary key. So when does
saveRecord inserts a new record ?

An other question is. Is it posssible to map the structure keys to
column names inside DataMgr. So that one does not have to change every
part of code if a column name changes.

Thanks for your help.

Mark


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Steve Bryant  
View profile  
 More options Apr 25 2011, 3:08 pm
From: Steve Bryant <sebto...@gmail.com>
Date: Mon, 25 Apr 2011 14:08:59 -0500
Local: Mon, Apr 25 2011 3:08 pm
Subject: Re: [DataMgr] saveRecord Behaviour Understanding Problem
Mark,

Terribly sorry about the long-delay in getting your message approved.
Somehow I got out of the habit of checking my GMail.

Great question on saveRecord and something I probably have not made
clear enough.

Check out the "OnExists" section under "insertRecord":
http://www.bryantwebconsulting.com/docs/datamgr/save-data.cfm

The upshot of this is that saveRecord will update a record based
either on primary key or if it finds an existing record matching the
given data. What you want is insertRecord() with OnExists="save". I
realized this was a bit confusing after I already had a whole bunch of
code dependent on the current set up.

It isn't currently possible to map structure keys to column names, but
I love that idea. I'll have to ponder how best to do that. In the
meantime, if you (or any else) have any idea on how you would like
that to work, let me know.

Steve


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "R: [DataMgr] saveRecord Behaviour Understanding Problem" by Salvatore FUSTO
Salvatore FUSTO  
View profile  
 More options Apr 26 2011, 3:18 am
From: "Salvatore FUSTO" <ing.fu...@gmail.com>
Date: Tue, 26 Apr 2011 09:18:19 +0200
Local: Tues, Apr 26 2011 3:18 am
Subject: R: [DataMgr] saveRecord Behaviour Understanding Problem
Mark,
i solved your second question in this way: i developed an abstract service
layer in which I inject dataMgr for database operations; in my object, I
have a custom tag attribute <cfproperty name... mapTo="myTable"/> so when I
have to persist my object I pass it to may service layer save() method,
where a new struct is defined and passed to insertRecord() or save Record().
Also, i define my object component with other custom attributes, one is for
cf componenent tag: <cfcomponent ... table="myTable"/> so I simply call the
service layer save(myObj) and it has all, from metadata, to save record in
the proper table with the proper mapping.
Hope been clear and usefull
salvatore

-----Messaggio originale-----
Da: datamgr@googlegroups.com [mailto:datamgr@googlegroups.com] Per conto di
Mark
Inviato: sabato 23 aprile 2011 12.23
A: DataMgr
Oggetto: [DataMgr] saveRecord Behaviour Understanding Problem

Hi, I just started using DataMgr and have a little problem with
understanding what saveRecord does. I tought that if I do not pass a
value for the primary key it automatically inserts a now record - but
what it does is updating the record for the primary key. So when does
saveRecord inserts a new record ?

An other question is. Is it posssible to map the structure keys to
column names inside DataMgr. So that one does not have to change every
part of code if a column name changes.

Thanks for your help.

Mark

--
You received this message because you are subscribed to the Google Groups
"DataMgr" group.
To post to this group, send email to datamgr@googlegroups.com.
To unsubscribe from this group, send email to
datamgr+unsubscribe@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/datamgr?hl=en.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »