That depends on how you are setup, if I recall right it will if it exists
update the records rather than insert them.

I haven't done it in this manner, but if it was me I would be rather be
try/catch around the block and not deal with updating or inserting.

The question needed to know here is what are you doing if a duplicate does
comes in, if you aren't doing anything with the database then versioning the
data and placining it into a try/catch block would ensure integrity here,
and do what ever you need to do then.

I am only guessing with a lot of what you are trying to do, but yeah the way
you are going about it seems complicated with no gain.




On Thu, Dec 17, 2009 at 12:52 PM, Charlie Stell <[email protected]>wrote:

>
> Maybe ORM will do more than I originally thought... If I start with two
> empty tables - domain and email, and get an email from
> [email protected](curDomain-gmail.com, curUser-xyz), and the code below
> runs, two records
> will be inserted (one in each table).
> And then later on, I get an email form [email protected], I can run this exact
> same code and it will know not to insert a new record into domain?
>
> domain = entityNew("domain");
> > domain.setName(curDomain)
> > email = entityNew("email")
> > email.setDomain(domain);
> > email.setUser(curUser);
> > domain.save();
> >
> >
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329206
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to