Booksleeve是否适用于Windows Redis(Redis作为Windows服务安装)?(Does Booksleeve work with a windows Redis (Redis installed as a Windows Service)?)
Booksleeve是否适用于Windows Redis(Redis作为Windows服务安装)?
我安装Redis作为Windows服务 ,我想知道是否可以使用BookSleeve? 或者BookSleeve专门用于安装在Unix系统上的Redis吗?
Does Booksleeve work with a windows Redis (Redis installed as a Windows Service) ?
I Installed Redis as a Windows Service and I wanted to know if it was possible to use BookSleeve with it? Or is BookSleeve exclusively for a Redis installed on a Unix system?
原文:
最满意答案
collection1
的类型为Collection
。 而Collection
没有collection2
字段。 这就是我对这些查询的理由。您必须在集合上创建显式连接:
select e from Entity1 e left join fetch e.collection1 as c1 left join fetch c1.collection2 as c2
请注意,这将生成笛卡尔积,因此可能会返回大量行。 另请注意,只有两个集合中的一个至少是一个集合才有可能。 如果它们都是包,那么Hibernate在执行查询时会抛出异常。
collection1
is of typeCollection
. And aCollection
doesn't have acollection2
field. That's how I reason about those kind of queries.You must the create an explicit join over the collection:
select e from Entity1 e left join fetch e.collection1 as c1 left join fetch c1.collection2 as c2
Note that this will produce a cartesian product, and thus petentially returns a huge number of rows. Also note that it will only be possible if one of the two collections at least is a set. If they're both bags, Hibernate will throw an exception when executing the query.
相关问答
更多-
在JPQL中,规范中也是如此。 JPA规范不允许将别名赋予获取联接。 问题在于,通过限制联合抓取的上下文,您可以轻松地将自己拍摄在脚下。 加入两次更安全。 ToMany通常比ToOnes更像一个问题。 例如, Select e from Employee e join fetch e.phones p where p.areaCode = '613' 这将错误地返回所有包含'613'区号中号码的员工,但会在返回列表中排除其他地区的电话号码。 这意味着在613和416区号中有电话的员工将丢失416电话号 ...
-
Hibernate中左连接和左连接FETCH之间的区别?(Difference between LEFT JOIN and LEFT JOIN FETCH in Hibernate?)[2023-07-15]
“fetch”告诉hibernate现在加载它,而不是让它懒洋洋地加载。 参考指南有整个章节处理这些事情,这是很好的熟悉。 The "fetch" tells hibernate to load it now instead of letting it be loaded lazily. The reference guide has a whole chapter dealing with such things that it's good to be acquainted with. -
在这两个查询中,您使用JOIN来查询至少有一个部门关联的所有员工。 但是,区别是:在第一个查询中,您只返回Hibernate的Employes。 在第二个查询中,您将返回Employes 和所有部门关联。 因此,如果使用第二个查询,则不需要再次查询新数据库以查看每个员工的部门。 当您确定需要每个员工的部门时,可以使用第二个查询。 如果您不需要Department,请使用第一个查询。 如果您需要应用某些WHERE条件(您可能需要什么),我建议阅读此链接: 如何正确表达JPQL“join fetch”与“whe ...
-
我认为这些文档描述得非常好。 如果您使用读取连接,相关实体将包含在水合结果中。 否则,他们不会,如果您尝试访问它们,它会触发另一个查询来获取信息。 这只是它是否应该包含在结果中的问题。 I think the docs describe it pretty well. If you use a fetch join, the related entities will be included in the hydrated result. Otherwise they won't, and if you t ...
-
mysql join和fetch(mysql join and fetch)[2023-09-06]
试试这种方式: $query = mysql_query("SELECT t2.*, t1.hotelprice FROM t2 LEFT JOIN t1 ON t2.url = t1.tid WHERE area = '".$area."'"); while ( $row = mysql_fetch_array($query) ){ $node = $dom->createElement("marker ... -
请记住,最后,JOIN FETCH始终是JOIN。 默认情况下, @OneToMany关系是延迟加载的。 使用JOIN FETCH可以提前加载相关实体。 你可以找到更多信息阅读FETCH JOIN仍然是 Piotr Nowicki 的加入 Remember that, in the end, JOIN FETCH is always a JOIN. By default @OneToMany relationships are lazy loaded. Using JOIN FETCH you load t ...
-
学说取得连接(Doctrine fetch join)[2023-08-31]
取得加入和过滤收集不是一起工作得很好的事情。 以下是你应该这样做的方法: SELECT u, p FROM User u JOIN u.phonenumbers p JOIN u.phonenumbers p2 WHERE u.id = :id AND p2.type = :type 这对第二个加入的(而不是水合的) p2应用过滤,这导致了正确的水合和过滤。 Fetch joining and filtering a collecti ... -
检查一个SQL语法,你不能在where子句之后使用left join 。 如果您正在查看命名查询的SQL生成表单,您将看到查询中的连接表在连接之后出现where子句,并且应指定通过键链接这些表的相等条件。 左侧主表的主键和右侧连接表的外键。 连接表由多对一关联的属性指定。 @NamedQuery( name = "findOneWithLists", query = "from Table t left join User u where u.id= :id" ) Check a SQL ...
-
来自JPA规范 将setMaxResults或setFirstResult应用于涉及对集合进行提取连接的查询的效果未定义。 (JPA“Enterprise JavaBeans 3.0,Final Release”,Kapitel 3.6.1查询接口) Hibernate做正确的事情,但在内存中执行查询的一部分,这是非常慢的。 在我的情况下,差异在3-5毫秒到400-500毫秒之间。 我的解决方案是在查询本身内实现分页。 与JOIN FETCH一起快速工作。 after increasing memory f ...
-
FETCH JOIN最大深度?(FETCH JOIN maximum depth?)[2024-01-28]
collection1的类型为Collection 。 而Collection没有collection2字段。 这就是我对这些查询的理由。 您必须在集合上创建显式连接: select e from Entity1 e left join fetch e.collection1 as c1 left join fetch c1.collection2 as c2 请注意,这将生成笛卡尔积,因此可能会返回大量行。 另请注意,只有两个集合中的一个至少是一个集合才有可能。 如果它们都是包,那么Hibernate在 ...