Apache OFBiz:<entity-condition>和<entity-and>之间的区别?

时间:2016-09-23 12:19:42

标签: xml ofbiz

我是OFBiz的新手,在阅读电子书时,我无法区分这两种从数据库访问数据的方法。我谷歌但我没有找到合适的解释,请提前寻求帮助。< / p>

var employees = [

    {
        name: "Praveen",
        dateofbirth: new Date("July 24, 1992"),
        gender: "Male",
        salary: 12000,
        city: "Salem"
    }, {
        name: "Divya",
        dateofbirth: new Date("July 21, 1994"),
        gender: "Female",
        salary: 13500.33,
        city: "Thirupur"
    }, {
        name: "Elangovan",
        dateofbirth: new Date("May 5, 1989"),
        gender: "Male",
        salary: 14050.45,
        city: "Namakkal"
    }, {
        name: "Abinaya",
        dateofbirth: new Date("August 21, 1991"),
        gender: "Female",
        salary: 15230.78,
        city: "Thirupur"
    }, {
        name: "Surendran",
        dateofbirth: new Date("July 3, 1993"),
        gender: "Male",
        salary: 16302.44,
        city: "vellur"
    }, {
        name: "Hindhuja",
        dateofbirth: new Date("November 05, 1995"),
        gender: "Female",
        salary: 17000.11,
        city: "Salem"
    }
]

1 个答案:

答案 0 :(得分:1)

entity-and用于从数据库中获取数据,其中需要多个主键(复合PK)以获取单个记录,并且您希望所有匹配任何字段的记录,例如

等查询
select * from table where Colname=abc;

在实体条件下,您可以使用&#39; AND&#39; /&#39; OR&#39;来编写多个实体条件。子句。

错误是你在实体条件中使用的字段映射使用entity-expr

 <entity-condition list="anyList" entity-name="Table">
   <condition-expr field-name="colName1" from-field="variable1"/>
   <condition-expr field-name="colName2" from-field="variable2"/>
 </entity-condition>