Hibernate version: 3.0
This is a general request for information about how the cascade attribute operates when you have transient objects associated with persistent objects.
Assuming the following mapping, which in OGNL would look something like this
Code:
event.eventDate
event.startTime
event.venue
event.venue.name
event.venue.addressFirstLine
...
Code:
<class name="Event">
<property name="eventDate" type="date"/>
<property name="startTime" type="time"/>
<many-to-one name="venue" class="com.mydomain.Venue" column="venue_id"/>
</class>
<class name="Venue">
<property name="name" type="string"/>
<property name="addressFirstLine" type="string"/>
...
</class>
If I load a venue from the database, and associate it with a new Event object, what would be the effect of a cascade="save" on the many-to-one "venue" relation when saving the new Event object? Would it try to update the persistent Venue object?
If I have created a new Venue at the same time as the Event I would like it saved, but I don't want already-persisted Venues to be updated, as this is part of a separate business process.
Hope this makes sense.
Cheers,
Mike
Update - sorry: got the cascade style wrong. "save-update" makes this a completly irrelevant question.