- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
假设我有以下内容:
@Entity
class Product {
@OneToOne(Lazy)
ProductType type;
}
@Entity
class ProductType {
@ManyToOne(Lazy)
ProductFamily pf;
}
@Entity
class ProductFamily {
String name;
// ...
}
默认情况下,OpenJPA 的获取深度为-1,如果我查询产品:
select p from Product p
它最终会查询如下内容:
select p from product p
left join product_type
left join product_family
我已经阅读了有关获取深度的内容,并且我可以将获取深度限制为1,这意味着查询将仅获取直接关系:
select p from product p
left join product_type
但是我如何自定义查询以便能够为嵌套关系指定获取连接?我尝试了 left fetch join
并将字段添加到提取计划,但它不起作用。
明确一点:我希望所有 *-to-One 关系
默认情况下是惰性的,然后通过 fetch 连接微调关系
,但 OpenJPA 似乎忽略了惰性配置。
最佳答案
不确定我是否理解。如果您希望能够指定必须获取的内容,则需要将关联标记为惰性关联,并使用查询加载对象。默认情况下,*ToOne 关联是急切的,而 *ToMany 关联是惰性的。一旦标记为惰性,就可以进行以下查询:
select p from Product p // load only the products
select p from Product p
left join fetch p.type // load products with their type
select p from Product p
left join fetch p.type t
left join fetch t.pf // load products with their type and the family of their type
如果关联是急切的,无论用于加载实体的代码如何,都将获取其关联。
关于java - OpenJPA 1.2.1 : fine-grained fetch plan,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8390020/
微调 API 中关于 model 属性的 OpenAI 文档说明有点令人困惑: model The name of the base model to fine-tune. You can selec
微调 API 中关于 model 属性的 OpenAI 文档说明有点令人困惑: model The name of the base model to fine-tune. You can selec
当涉及到语言模型(LLM)的教学微调时,什么时候应该选择有监督的微调培训器(SFTTrainer)而不是常规的Transformers培训器?据我所知,常规的Transformers培训人员通常指的是
最近在处理后台数据时需要实现文件上传.考虑到对浏览器适配上采用Fine Uploader. Fine Uploader 采用ajax方式实现对文件上传.同时在浏览器中直接支持文件拖拽[对浏览器版本有
1f45bd1e8577af66a05f5e3fadb0b29 通过ORPO对llama进行微调 前言 ORPO是一种新颖的微调技术,它将传统的监督微调和偏好对齐阶段整合到一个过程中。这减少了训
我希望使用 Fineuploader 为每个上传的项目添加标题/名称。每个附件都会在其旁边显示一个文本框,以便用户可以在按“上传”之前输入标题/名称 like this 我看过了,每个上传请求都会发送
假设我想一次上传多个文件,将 multiple 选项设置为 true 时我可以这样做: var myUploader = new qq.FineUploader({ element: $('#
使用 Fineuploader v3.3 的 jQuery 封装版本。 是否可以使用上传文件夹中已有的文件填充文件列表? 我认为“_addToList(id, name)”应该可以解决问题,但我无法让
log4j.properties log4j.rootLogger=FINE, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppende
我想在我的小程序中使用 java util 日志记录,日志级别为 FINE 及以下。 我在我的小程序的 jar 中放了一个 logging.properties 文件 handlers= java.u
我的域层需要一个实体具有与之关联的 1:N 图像。 由于 FineUploader 将每个图像作为单独的请求发送,我在第一个请求上创建一个实体(服务器端),并在第一个响应 JSON 中发送回该 ID
关闭。这个问题需要debugging details .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 2年前关闭。 Improve this questio
我阅读了有关使用 Fine Uploader 进行缩放的文档: http://docs.fineuploader.com/features/scaling.html 是否可以仅考虑图片的高度来缩放图片
我正在使用很好的 uploader ,它运行得很好。现在,即使上传成功,它也会重试。这样一来,我就有了四个文件,而不是只有一个。 http://fineuploader.com/ 我的代码:
当我运行 Maven 时,我得到的输出就好像我指定了日志记录级别 FINE 一样,这使得很难找到实际的输出。我还得到了数百行列出显式和隐式绑定(bind)的信息。据我所知我根本没有配置 mvn 。我正
我在我的表单中使用 FineUploader:http://docs.fineuploader.com/branch/master/features/forms.html . 问题是,在我的表单文件中
我已经为此发了几个小时的消息,但无法让它工作。我对fineuploader的实现 $(document).ready(function() { //alert(qq.supportedFeatures
我有一个关于 fine uploader (3.0) 的奇怪问题,它适用于除 ie9 之外的所有浏览器。 没有js错误,就是上传一个0byte失败了。我正在使用 valums php,它在这里失败了:
我正在实现类似 Google Plus 上传窗口的功能,当窗口中的整个灰色区域 (div) 都可以点击时,文件选择器就会出现。 这是我正在尝试做的事情的简单模型代码 (jsfiddle) $(func
我正在使用Fine-uploader(繁体版)试图让用户上传文件到我们自己的服务器。我现在面临的挑战是我应该在正常上传过程之前先从服务器获取 token 。 token 将与每个上传请求/ block
我是一名优秀的程序员,十分优秀!