JPA用于查询内存数据
在导入过程中,我从 Excel 工作表中读取表格数据。 我想对这些数据执行一些操作:我想排序、按键搜索、过滤等。 是否可以通过 JQL 可靠地执行此类操作? 谢谢
During an import procedure, I read tabular data from excel sheets.
I want to perform some operation on this data: I want to sort, search by key, filter etc.
Is it possible to reliably perform this kind of operations via JQL?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我会使用 Space4J 和简单的集合来完成类似的事情。
就我个人而言,我认为所有这些 ORM 抽象和层都会分散小规模问题领域的注意力,并且在另一个极端上不灵活且增加了复杂性。
I would use Space4J and simple Collections for something like this.
Personally I think all these ORM abstractions and layers are a distraction at the small scale problem domains, and are inflexible and added complexity at the other extreme.
您可以使用内存数据库,例如 HSQLDB,填充它,然后使用 JPA 查询数据。但是使用一些地图和列表还不够吗?
You could use an in-memory database like HSQLDB, fill it, then use JPA to query the data. But wouldn't using some Maps and Lists be sufficient?
DataNucleus 有自己的 JDOQL 和 JPQL 语法内存中查询评估器。我从未在完整的 JDO / JPA 持久性环境之外使用过它,但没有真正的理由说明为什么它不能通过一些编码来工作
DataNucleus has its own in-memory query evaluator for JDOQL and JPQL syntaxis. I've never used it outside of a full JDO / JPA persistence environment but there's no real reason why it couldn't be made to work with a little coding
如果您使用 EclipseLink,则可以在内存中针对缓存执行大多数查询。
您只需将所有内容读入缓存,它们使用“CheckCacheOnly”选项执行 JPQL 或 Criteria 查询。
看,
http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development /缓存/Query_Options
If you are using EclipseLink, you can execute most queries in memory against the cache.
You just need to read everything into the cache they execute a JPQL or Criteria query with the "CheckCacheOnly" option.
See,
http://wiki.eclipse.org/EclipseLink/UserGuide/JPA/Basic_JPA_Development/Caching/Query_Options