使用JayData过滤头细节表 - 内部连接SQL,OData的(Using JayData to

2019-10-17 13:20发布

你好上午还挺新的,使用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 }   });

只是一个小的解释:表万事达规划器是一个详细表和表活性是标题表我需要选择所有从活动表中的活动(标题),其中,其在例如详细表实测值= 2如何船员ID我这样做的OData使用和JayData

我目前使用

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

这是误差未知表达类型来处理:EntitySetExpression本地主机/移动网络/ htdocs中/资产/ jayData / jaydata.js 89线

请帮助任何人!

谢谢 !

Answer 1:

你需要“一些”或“每一个”操作,请参阅本http://jaydata.org/blog/using-some-and-every-with-jaydata-odata-provider



Answer 2:

它看起来像一个已知的问题,我已经在增加它的github http://github.com/jaydata/jaydata/issues/70



文章来源: Using JayData to filter Header Detail Table - Inner Join SQL, oData