简体   繁体   English

HQl查询以从管道行检索数据

[英]HQl query to retrieve data from Pipe row

I had tried to fetch data which is returning as Array in oracle which is written in a function of oracle as pipe row. 我试图获取在oracle中作为Array返回的数据,该数据在oracle的函数中作为管道行编写。

When i tried using native query like select ar_0th_element from table(fn_name(arg)). 当我尝试使用本机查询时,请从表(fn_name(arg))中选择ar_0th_element。

the above code works fine in native sql query. 上面的代码在本机sql查询中工作正常。

how to do the same thing using hql. 如何使用hql做同样的事情。

HQL, much like JPQL, are languages that are designed to work on entities . 与JPQL一样,HQL是设计用于实体的语言。 Your table-valued function TABLE(fn_name(arg)) is not an entity, so it's best to stick to native SQL. 您的表值函数TABLE(fn_name(arg))不是实体,因此最好坚持使用本机SQL。

If your table-valued function actually returns values that can be mapped to entities, you can still do this using native SQL, by calling EntityManager.createNativeQuery(String, Class) 如果您的表值函数实际上返回了可以映射到实体的值,您仍然可以使用本地SQL通过调用EntityManager.createNativeQuery(String, Class)来执行此操作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM