English 中文(简体)
我怎么能够向我的实体介绍一下“json”变化。
原标题:How can I update my entities with a json changeset?

Given optimistic concurrency using a version property and a json rest-service with a client that returns changesets consisting of the Id, Version and changed properties only, how can I update my server-side entity?

我想要做的是,将我的json推为一个精干的实体,然后使用ISession。 更新实体的方法。 然而,我的附属实体对许多财产将无价值,如果我称之为“合并”的话,我的实体将更新所有这些财产,这不是我想要的东西。 如果有办法说明合并,忽视那些无效的财产,并保留将解决我的问题的持久性实体的任何相应的非核价值。

If there is no way to configure the behaviour for merge, I could of course get the persisted entity and implement my own merging method using reflection. The problem with this approach is that it requires that I first query the db for the entity and then update it, whereas the merge method should do this as one operation unless I am mistaken.

你可能会问,为什么我只想通过改动,而不是完整的实体。 这是因为,它使我能够发送最低限度的数据,它还明确表明用户正在努力改变的情况,我可以用来测试用户的权利。

如果无法在祖国的界限内做到这一点,你将如何行事?

最佳回答
问题回答

暂无回答




相关问题
nHibernate one-to-many inserts but doesnt update

Instead of getting into code, I have a simple question. Default behavior for a simple one-to-many is that it inserts the child record then updates the foreign key column with the parent key. Has ...

How Do I copy an existing nhibernate object as a new object?

I a persisted NHibernate object that I would like to repersist as a new entity. How do I get NHibernate to save this object as if it was a new? I am thinking I might create a session interceptor to ...

join across databases with nhibernate

I am trying to join two tables that reside in two different databases. Every time, I try to join I get the following error: An association from the table xxx refers to an unmapped class. If the ...

WPF - MVVM - NHibernate Validation

Im facing a bit of an issue when trying to validate a decimal property on domain object which is bound to a textbox on the view through the viewmodel. I am using NHibernate to decorate my property on ...

NHibernate Search in a List using ICriteria

I have my class X : public class ClassX { public virtual IList<ClassY> ListY { get; set; } ... } My ClassX mapping (using Fluent) ... HasMany<ClassX>(x => x.ListY ) ....

热门标签