开发者

db4o SODA compare field values

开发者 https://www.devze.com 2023-01-24 23:31 出处:网络
class SomeClass { private DateTime fieldA; private DateTime fieldB; } Using SODA, what is the proper way to select all objects whose fieldA is greater than fieldB?
class SomeClass
{
  private DateTime fieldA;
  private DateTime fieldB;
}

Using SODA, what is the proper way to select all objects whose fieldA is greater than fieldB?

Something like this?

var que开发者_如何学编程ry = this.ObjectContainer.Query();
query.Constrain(typeof(SomeClass));
query.Descend("fieldA").Constrain(query.Descend("fieldB")).Greater();
var list = query.Execute();


You mean how to express a query like the following (SQL)

select * from SomeTable where fieldA > fieldB

in SODA, right?

I am afraid this is not possible (at least not without using an evaluation or a native query - which, in this case, will run as an evaluation anyway).

Best

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号