问题标签 [jaydata]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1335 浏览

odata - 如何让 Breeze 查询 $metadata 而不是 Metadata?

我使用 Node、MongoDB 和 JayData 设置了我的 odata 服务。当我http://localhost:8000/odata/findash.svc/$metadata在浏览器中点击时,我得到的元数据完全符合我的预期。

在浏览器控制台中,我执行以下示例代码:

弹出一条带有消息的警报:Error: Metadata query failed for: odata/findash.svc/Metadata; Not Found

net 选项卡确认 Breeze 正在命中odata/findash.svc/Metadata,它会产生 404 而不是odata/findash.svc/$metadata正常工作。

有没有办法在 Breeze 中配置此行为,或者我的 odata 设置有问题?

0 投票
1 回答
472 浏览

odata - Breeze & OData:无法扩展集合

什么有效:

在 Breeze 中,我可以执行以下查询:

第一季度

这导致了这个请求:

R1

它返回正确的数据,除了 transactions 属性如下所示:

我尝试在浏览器中点击 transactions.__deferred.uri 的 URI

R1.1

它确实响应了我期望的交易。

什么不起作用:

为了尝试通过 Breeze 获取该事务列表,我使用如下所示的 expand 子句更改上述查询:

第二季度

这导致了这个请求:

R2

这会产生 500 错误。

我也试过这个微风查询:

第三季度

这也会产生 500 错误。

我需要知道的:

在深入研究基于 Node+MongoDB+JayData 构建的 OData 服务之前,我试图排除 Breeze。

上面 R1 和 R2 之间的唯一区别是添加了&$expand=transactions. R1 工作,R2 导致 500 错误。如果 R2 是一个有效的 OData 请求,那么我需要将我的故障排除工作集中在我的 JayData 实施上。对我来说,麻烦在于我是 Breeze、OData 和 JayData 的新手,所以我无法缩小搜索范围。

作为参考,我的 JayData context.js 在这里:

0 投票
1 回答
778 浏览

odata - Breeze.js : how to store an entity relation using the OData adapter

My goal is to persist a simple relationship between two breeze entities on my OData server.

I've setup a server, I am able to:

  • insert data
  • query data
  • create a relation between two entities client-side
  • BUT not able to persist the relationship server-side.

Any ideas of what I'm missing?

Below is my setup details


  • I'm using OData/MongoDB backend running JayData on Node.js (virtualBox, ubuntu 12.04, node.js, MongoDB)
  • I have created a simple data model with a user and a person entity based on this stack overflow question. This is the JayData datamodel definition

>

  • I'm able to query the data using Breeze.js
  • I'm able to insert User and Person entities using Breeze.js
  • I'm able to set a relation in Breeze and I see the changes to the entities
  • I've updated Breeze.js to 1.3.3

>

But I only see two OData post for the two entities but nothing to tie the two entities together

  • I ruled out the OData adapter as both the WebAPI and OData adapter call the same functions in the Breeze code base and there are multiple Breeze/WebAPI that demonstrate the ability to query and inserted related entities.
  • I haven't seen a Breeze.js / OData sample that seems to address this.
  • The closest example that works is a datajs code sample. It posts the related entity to /$links/ to create the relationship (something I don't see in the OData adapter of neither Breeze.js or JayData).
0 投票
1 回答
129 浏览

javascript - JayData 中的关系数据

我正在将现有应用程序从 WebSql 重写为 JayData。该应用程序是建立在 WebSql 之上的,它被贬低了,需要被替换(至少迟早)。我将所有 WebSql 重新分解为它自己的适配器,现在正在尝试使用 JayData 编写一个并行适配器。

我想知道的是如何优雅地处理 sql join。这是一个例子

我在上下文中有两个 jayData 实体“ table1”和“ table1Local”。这是我的粗略尝试,但它没有加入数据。

我对如何使它正常工作有点迷茫。

0 投票
0 回答
494 浏览

iis - 使用 jaydata.js 调用 odata webservice 返回 401

我使用 jaydata.js 调用了 odata 网络服务,但它返回 401 Unauthorized。

即使浏览到服务并首先在第二个浏览器选项卡中手动进行身份验证,仍然会在第一个选项卡中获得 401。

这是我的代码:

这是来自浏览器的信息:

我在这件事上完全是菜鸟,所以任何关于解决方案或更好地理解问题的建议都可能会有所帮助

0 投票
2 回答
209 浏览

jaydata - JayStorm 数据服务插入/更新/删除/查询拦截

如果我想在我的 odata 插入/更新/删除/查询端点中注入一些代码,有没有办法做到这一点?

例如:

  • 在查询时,我想注入基于安全性的进一步限制(例如,如果角色为 x,则返回数据子集)。
  • 在更新时,我想防止某些字段被更新(如 CreateDate),因此需要某种形式的过度保护。或者我不想让常规用户更新管理数据列。
  • 在插入/更新时,我希望基于服务器的逻辑计算某些列值并进一步触发某些服务器操作。
  • 删除时我想取消删除,将记录插入审计表并设置实体的 DeleteDate 列 - AKA 软删除。

这些可能吗?有关如何执行此操作的任何文件/教程?

谢谢

0 投票
1 回答
220 浏览

knockout.js - 如何使用 Knockout ko.computed 属性创建 JayData 模型实体?

使用这个简单的示例模型:

您将如何使用 JayData 实现 FullName?

0 投票
1 回答
349 浏览

jaydata - Jaydata 中的复杂字段操作

数据库图

我有一个这样的数据库结构。每个员工都属于一个部门,每个股票都属于一个部门,每个部门都有一个员工列表和与之关联的股票列表。我使用以下代码初始化数据库:

我想做的是向该数据库添加元素,但我必须建立正确的连接。我的意思是正确的连接,我想查询所有员工的姓名,这需要我查找部门名称并从中获取员工列表,然后列出他们的姓名。我尝试了很多东西,但完全失败了。例如:

未能在员工内部插入正确的部门信息。当我查询 Employee1 的部门字段时,我得到未定义。

这也失败了:

所有查询都成功地将一些数据插入到数据库中,但它们的部门字段为空,这违背了拥有关系数据库的全部目的。

0 投票
2 回答
759 浏览

jaydata - 无法解析类型:System.Data.Spatial.DbGeography 与 odata 中返回的 sql server 地理数据类型

我在 sql server 中有一个地理类型的表。我使用实体框架和 EntitySetController 返回包​​含地理列的实体的 [Queryable] 列表。

以下是返回数据的示例:

Jaydata 在工厂配置模式下抛出异常:“无法解析类型:System.Data.Spatial.DbGeography”。

我究竟做错了什么?如何以它喜欢的方式将地理列返回到 jaydata?

谢谢

编辑:

@robesz 根据您的 JayStorm Paas Open Edition 建议,我创建了一个帐户,创建了一个匹配的架构,创建了一个 .Net 控制台应用程序来添加一些数据,但它抱怨 GeoLocation 列中的格式无效。我该如何解决?此外,当我执行行 SaveChanges() 时,它首先抱怨需要 odata v3,但导入过程硬编码 V2,所以我手动编辑了生成的客户端存根(不理想) - 我将如何解决这个问题?而且,没有更简单的方法可以将数据导入 JayStorm 表吗?最后,我在哪里可以找到超过 100 万条记录的定价?

0 投票
1 回答
659 浏览

kendo-ui - Using durandal with jaydata and kendoui

I created a new VS2012 project using the hottowel template, which in return uses durandal, knockout and breeze.

I want to use jaydata instead of breeze and for the ui layer I want to use the excellent asKendoDataSource() functionality to power a kendoui grid.

I followed all the instructions to make kendoui work well with durandal. This is fine.

I have a model in which I get the jaydata entities and run asKendoDataSource() on it. My view is an MVVM declared kendoui grid with its source property set to the viewmodel's property that contains a reference to the asKendoDataSource().

In the knockout world the viewModel property would be an empty entities = ko.observableArray() which would then would be initialized by using entities(values) when the data service returns.

I need to mimic this such that I have a viewModel property that is an empty kendo datasource which then is initialized by the asKendoDataSource() conversion when the data comes back from jaydata. This way the mvvm kendo grid is bound initially to the empty datasource and then receives its items when the asKendoDataSource() is called.

This is all because the model - viewModel binding in durandal is asynchronous and there needs to be a placeholder property in the viewModel from the very beginning, which then, after the viewModel's activate() method promise is resolved, gets updated with the bound data and in return powers the DOM that the viewModel is bound to.

I can't figure out how to mimic the knockoutjs practice of an empty observable array which is bound to the dom and then (the same exact reference) gets initialized and populates the dom. There seems to be no way to create an empty kendo datasource which then is re-initialized by the asKendoDataSource() method. Reassigning the viewModel property to the new data source doesn't work because the kendo grid is bound to the original reference.

This is my airport view:

This is my datacontext:

This is my airport viewmodel:

One last issue that I am seeing: It seems to me that an MVVM declared kendoui grid, bound to the view model through data-kendo-bind={source: airports)" where airports is a property of the viewmodel that was created through entities.asKendoDataSource() does not work. Somehow the grid does not show the data. Is there something extra that needs to be done?

Thanks