JQL ORDER BY 子句和继承
假设我有一个实体类 A
、两个继承自 A
的实体类 B
和 C
以及实体类D
继承自C
。 A
和 C
是抽象实体。实体A
有一个字段name
。如何构造一个 JQL 查询,该查询按每个实体类中的名称对实体进行排序。按 name
排序的类 B
的实体应该首先进入,然后应该进入类 B
的实体(也按名称排序),然后是类的实体D
。
Let's say I have an entity class A
, two entity classes B
and C
which inherits from A
, and entity class D
which inherits from C
. A
and C
are abstract entities. Entity A
has a field name
. How one could construct a JQL-query which orders entities by name within each entity class. Entities of class B
sorted by name
should go first, then should go entities of class B
(also sorted by name), and then of class D
.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JPA 2.0 中添加了 Type() 函数。以前,您需要映射类型字段才能对其进行查询。
The Type() function was added in JPA 2.0. Previously you would need to map the type field to be able to query on it.