首页 \ 问答 \ Hibernate Collection链接(Hibernate Collection chaining)

Hibernate Collection链接(Hibernate Collection chaining)

我有两个实体

University   
   courses

Course
   students

我想访问大学里的所有学生。 我尝试了以下查询

select u.courses.students from university u

我有以下例外。

org.hibernate.QueryException: illegal attempt to dereference collection [university0_.id.courses] with element property reference [students] [ select u.courses.students from com.socialsite.persistence.University u  ]
    at org.hibernate.hql.ast.tree.DotNode$1.buildIllegalCollectionDereferenceException(DotNode.java:46)
  .....

任何人都能解释这有什么问题吗?


I have two Entities

University   
   courses

Course
   students

i want to access all the students in a university. I tried the following query

select u.courses.students from university u

i got the following exception.

org.hibernate.QueryException: illegal attempt to dereference collection [university0_.id.courses] with element property reference [students] [ select u.courses.students from com.socialsite.persistence.University u  ]
    at org.hibernate.hql.ast.tree.DotNode$1.buildIllegalCollectionDereferenceException(DotNode.java:46)
  .....

can anyone explain what is wrong with this?


原文:https://stackoverflow.com/questions/2550885
更新时间:2022-04-24 09:04

最满意答案

您无法使用实时SDK版本执行此操作,此功能已添加到当前正在开发中的CARTO Mobile SDK 4.1.0中。

查看更多: https//github.com/CartoDB/mobile-sdk/issues/88

更新:SDK 4.1.0 alpha版本现在可以从nuget (适用于iOSAndroid )获取,只需在nuget包装载器中启用“预发布”版本,然后选择4.1.0-alpha-8或更新版本的CartoMobileSDK


You cannot do this with live SDK version, this feature is added to CARTO Mobile SDK 4.1.0, currently in development.

See more: https://github.com/CartoDB/mobile-sdk/issues/88

Update: SDK 4.1.0 alpha version can now be taken from nuget (for iOS or Android), just enable "Pre-release" versions in nuget package loader and pick 4.1.0-alpha-8 or newer for CartoMobileSDK.

相关问答

更多