您好,我是新手,并且使用JayData和oData,所以请原谅我的无知。

这是我的对象结构:

$data.Entity.extend('PlannerModel.vMasterPlanner', {
    'Sequence_Number': { key:true,type:'Edm.Int32',nullable:false,required:true },
    'Scenario_Name': { type:'Edm.String',nullable:true,maxLength:250 },
    'Activity_ID': { type:'Edm.String',nullable:false,required:true,maxLength:250 },
    'Activity_Description': { type:'Edm.String',nullable:true,maxLength:500 },
    'Object_ID': { type:'Edm.String',nullable:true,maxLength:250 },
    'Object_Description': { type:'Edm.String',nullable:true,maxLength:400 },
    'Operation_Code': { type:'Edm.String',nullable:false,required:true,maxLength:250 },
    'Operation_Description': { type:'Edm.String',nullable:true,maxLength:50 },
    'Crew_ID': { type:'Edm.String',nullable:true,maxLength:250 },
    'Crew_Name': { type:'Edm.String',nullable:true,maxLength:50 },
    'Period': { type:'Edm.Int32',nullable:true },
    'vActivity': { type:'PlannerModel.vActivity',required:true,inverseProperty:'vMasterPlanners' }   });

 $data.Entity.extend('PlannerModel.vActivity', {
    'Activity_ID': { key:true,type:'Edm.String',nullable:false,computed:true },
    'Activity_Name': { type:'Edm.String',nullable:false,required:true },
    'vMasterPlanners': { type:'Array',elementType:'PlannerModel.vMasterPlanner',inverseProperty:'vActivity' }   });


$data.EntityContext.extend('PlannerServiceLibrary.PlannerEntities', {
    ProgressDetails: { type: $data.EntitySet, elementType: PlannerModel.ProgressDetails },
      ProgressHeaders: { type: $data.EntitySet, elementType: PlannerModel.ProgressHeader },
      vCrews: { type: $data.EntitySet, elementType: PlannerModel.vCrew },
      vPeriods: { type: $data.EntitySet, elementType: PlannerModel.vPeriod },
      vOperations: { type: $data.EntitySet, elementType: PlannerModel.vOperation },
      vActivities: { type: $data.EntitySet, elementType: PlannerModel.vActivity },
      vMasterPlanners: { type: $data.EntitySet, elementType: PlannerModel.vMasterPlanner }   });


只是一点解释:
 表主计划程序是明细表,表活动是表头表
我需要从活动表(标题)中选择所有活动,其中在详细信息表中找到的乘员组ID例如= 2
我如何使用oData和JayData做到这一点

目前正在使用

provider.vActivities.filter(function (ac) {
return ac.vMasterPlanners.Crew_ID == "FM2_F/W" })
               .toArray(function (e) {
                   console.log(e);
               });


这是要处理的错误未知表达式类型:EntitySetExpression
 本地主机/移动网络/htdocs/assets/jayData/jaydata.js
89号线

请帮助任何人!

谢谢 !

最佳答案

您需要“一些”或“每个”运算符,请参见此http://jaydata.org/blog/using-some-and-every-with-jaydata-odata-provider

10-08 18:51