Bulk Update using UpdateBuilder #3141
Answered
by
bahusoid
satishviswanathan
asked this question in
Q&A
-
I'm trying to do a bulk update as shown below.
This is what I'm seeing in the error. Seems like the join between Employee and Score is not working. NHibernate: Models
Mapping
Not sure what i'm missing here. |
Beta Was this translation helpful? Give feedback.
Answered by
bahusoid
Jan 21, 2022
Replies: 1 comment
-
Updates on association entities ( As a workaround you can try to rewrite this DML using subquery. Something like: IQueryable<Score> scoreToUpdateSubQuery = session.Query<Employee>().Where(x => x.Name.StartsWith("sa")).Select(e => e.Score);
await session.Query<Score>()
.Where(e => scoreToUpdateSubQuery.Contains(e))
.UpdateBuilder().Set(s => s.Performance, 10)
.UpdateAsync(ct).ConfigureAwait(false); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
hazzik
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Updates on association entities (
y.Score.Performance
) are not supported.As a workaround you can try to rewrite this DML using subquery. Something like: