Does anyone know if it's possible to add an item to a collection without actually retrieving the persisted items in that collection? Is there a mapping that will allow me to achieve this?
I have a scenario where I'm performing some batch processing on some customer objects. I want to add some notes to my customers as I go but don't want/need the already persisted notes for that customer as it's a background process and simply adds to the collection.
18.5.3. Bags and lists are the most efficient inverse collections
In any case, you can skip the collection completely and just use a many-to-one (i.e. set Note.Customer instead of adding a Note to Customer.Notes)
I'm not sure about your original question, but I can offer a workaround- create a new Note object, set its Customer property to the wanted customer, and persist it. simple, and works well for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With