JPA单向@OneToMany性能(JPA unidirectional @OneToMany performance)
我有两个具有
unidirectional @OneToMany Lazy
关系的实体。 当我尝试添加一个孩子时,似乎Hibernate 4(我的JPA提供者)实际上正在执行
- 选择查询
- 删除连接表上具有该父ID的所有子项
- 在连接表上重新插入所有和新子项
如何让Hibernate只插入我想要的孩子,而不改变我的关系?
I have two entities with
unidirectional @OneToMany Lazy
relationship. When I try to add a child, it seems like Hibernate 4 (my JPA provider) actually performs
- Select query
- Delete all children with that parent id on join table
- Reinsert back all and the new child on join table
How to make Hibernate to just insert the child I wish, without changing my relationship?
原文:https://stackoverflow.com/questions/18333198
最满意答案
经过几周的搜索,我会和Drools一起去。 看起来唯一可能的选项可以满足项目的需求https://www.drools.org/
After few weeks of search , i will go with Drools. Looks like the only possible option can fit the needs for the project https://www.drools.org/
相关问答
更多-
本地开发服务器是否可以仅用于模拟云数据存储?(Can the local development server be used to only simulate Cloud Datastore?)[2022-08-16]
您是否尝试过使用云数据存储的本地开发服务器 ? 这听起来就像你在找什么。 Have you tried using cloud datastore's local development server? It sounds like exactly what you are looking for. -
规则引擎 - 利弊(Rules Engine - pros and cons)[2022-05-30]
我看到的大多数规则引擎被系统代码看作是一个黑盒子。 如果我要构建域模型,我可能希望某些业务规则是域模型的内在的,例如,当对象具有无效值时告诉我的业务规则。 这允许多个系统共享域模型而不重复业务逻辑。 我可以让每个系统使用相同的规则服务来验证我的域模型,但这似乎削弱了我的域模型(正如问题中指出的那样)。 为什么? 因为我始终在所有系统上始终执行我的业务规则,而是依靠系统程序员来确定业务规则何时被执行(通过调用规则服务)。 这可能不是一个问题,如果域模型来到你完全填充,但如果您正在处理一个用户界面或系统改变域模 ... -
Free / OpenSource Java规则/工作流引擎[已关闭](Free / OpenSource Java Rules / Workflow engine [closed])[2023-05-06]
以下是许多开源Java规则引擎的简要介绍 ,其中包括像Drools等常见的犯罪嫌疑人。 Here is a rundown of many open-source Java rules engines including the usual suspects like Drools, etc. -
您可以使用Google Cloud Datastore API (目前处于预览版)从计算引擎连接到数据存储区 目前,不支持像Objectify这样的App Engine Java客户端库,只支持基于protobuf的低级Java API:请参阅Java入门指南 。 我在公共问题跟踪器上创建了一个问题,因为这是工程团队有兴趣在将来支持的。 You can connect to the Datastore from Compute Engine using Google Cloud Datastore API ...
-
基于PHP(云)应用程序的一种替代方法是PHP Fog 。 它也似乎有你需要的MySQL功能。 由于此服务本质上是云托管服务,因此您无需处理底层图层,因此它可以处理防火墙配置和类似要求。 I think the best solution that fit my criteria is Scalr . This is the ultimate PaaS solution out there. Auto mysql scaling, auto app scaling, you can create roles ...
-
如果你确定你需要一个规则引擎,你需要找到一个可以在Ruby中使用的规则引擎。 谷歌的快速搜索带来了Rools(http://rools.rubyforge.org/)和Ruby Rules(http://xircles.codehaus.org/projects/ruby-rules)。 我不确定这两个项目的状态。 使用JRuby和Drools可能是你最好的选择,但话说回来,我是一名Java开发人员和Drools的大倡导者。 :) 在不了解所有细节的情况下,有点难以说明应如何实施。 它还取决于您希望如何更新 ...
-
在一个已经SO脚步的库似乎工作,你可以使用具有更好性能的php-gettext-memcached ! They still do not support the gettext extension (now June 2016, issue started October 2014), so in the end I resorted to using this gettext library, which works just fine. I used the following code to che ...
-
CodeEffects规则引擎 - (PHP - Java - 云替代)(CodeEffects Rules Engine - (PHP - Java - Cloud Alternative ))[2023-03-12]
经过几周的搜索,我会和Drools一起去。 看起来唯一可能的选项可以满足项目的需求https://www.drools.org/ After few weeks of search , i will go with Drools. Looks like the only possible option can fit the needs for the project https://www.drools.org/ -
zend引擎如何编译php代码或者PHP编译器如何工作?(How zend engine compile php codes or How php compiler works?)[2021-09-11]
这与PHP的想法相同: 第一步:PHP源代码(即一些文本)被编译为一组操作码 第二步:这些操作码被执行。 默认情况下,每次执行PHP脚本时都会执行此编译 - 这需要一些CPU。 这就是为什么您可以使用某些操作码缓存(如APC扩展 )将操作码存储在内存中的原因 - 避免冗余编译步骤。 在Sebastian Bergmann的以下演示中,您将能够找到关于这些过程的一些有趣信息: PHP Compiler Internals It's kind of the same idea with PHP : First ... -
如果您100%确定不需要任何后端逻辑,并且永远不会,请参阅在Android中使用Google Cloud Storage JSON api进行直接Android < - > Google云端存储操作。 通常,在应用程序成功的过程中,最终需要后端的一些逻辑(例如,处理不同版本的客户端 - 并非所有更新都在同一纳秒:-),因此通常更谨慎和未来 - 使前端可以访问App Engine后端,除了提供对云存储的访问权限之外,还可以应用所需的任何逻辑。 在版本0.1,所需的逻辑量可能非常小(尽管通常至少是某种类型的身份 ...