Hi,

Let's say I have the following model:

class Person
class Pet

Person can have many pets
Pet has a unique name.


Now I get a list of Pet's names and I have to Create a person, assign 
Pets to it, and save it to the DB.
But there's a twist - There may or may not be a pet with given name.

So I either want to INSERT a new pet, or UPDATE existing one. I don't 
have an Id of Pet, only it's Name (which has unique constraint on it, 
but is not a primary key)

How can I do that in an efficient way?

Regards,

Krzysztof



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to