使用JayData来过滤标头详细表-内部连接SQL, oData



你好,我是新手,使用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);
               });

,这是错误未知表达式类型处理:EntitySetExpressionlocalhost/移动web/根/资产/jayData/jaydata.js第89行

请帮助任何人!!

您需要'some'或'every'操作符,请参阅此http://jaydata.org/blog/using-some-and-every-with-jaydata-odata-provider

这看起来像是一个已知的问题,我已经把它添加到github http://github.com/jaydata/jaydata/issues/70

相关内容

  • 没有找到相关文章

最新更新