Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merging a bidirectional list creates unnecessary UPDATE statement #1530

Open
RogerKratz opened this issue Jan 12, 2018 · 0 comments
Open

Merging a bidirectional list creates unnecessary UPDATE statement #1530

RogerKratz opened this issue Jan 12, 2018 · 0 comments

Comments

@RogerKratz
Copy link
Contributor

Having following mapping...

<class name="Parent">
	<id name="Id" type="guid">
	  <generator class="guid.comb" />
	</id>
	<list name="Children" cascade="all-delete-orphan" inverse="true">
		<key column="Parent" not-null="true"/>
		<list-index column="OrderIndex"  />
		<one-to-many class="Child"/>
	</list>
	<property name="Name" />
</class>

<class name="Child">
	<id name="Id" type="guid">
	  <generator class="guid.comb" />
	</id>
	<many-to-one name="Parent" class="Parent" />
	<property name="OrderIndex" access="readonly"/>
	<property name="Name" />	
 </class>

...will cause INSERT + UPDATE when adding a new child and doing session.Merge(parent).

Will add a PR soon.

RogerKratz added a commit to RogerKratz/nhibernate-core that referenced this issue Jan 12, 2018
@hazzik hazzik added p: Lowest and removed p: Minor labels Nov 5, 2018
@fredericDelaporte fredericDelaporte changed the title Merging a bidirectonal list creates unecessary UPDATE statement Merging a bidirectional list creates unnecessary UPDATE statement Nov 19, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants