users@jpa-spec.java.net

[jpa-spec users] Re: JPA support for recursive data structures / object graphs

From: Heiko Wagner <heiko.wagner_at_apis.de>
Date: Wed, 27 Jan 2016 07:01:08 +0100

 

Hi Paul,

(recursive) CTEs are part of SQL:1999 standard (see
https://en.wikipedia.org/wiki/SQL:1999#Common_table_expressions_and_recursive_queries).
Most mainstream RDBMS support them. I am using SQLite for my POC
application, which has support for recursive CTEs. The only major RDBMS
that lacks support for it is, as far as I know, MySQL.

Regards,

Heiko

Am 2016-01-26 17:51, schrieb Paul Benedict:

> Christian, I am only aware of Oracle using CONNECT BY. Are there other database vendors that support this? If it's only one vendor, I am not sure a general JPA solution is appropriate; but that's going to be based on your researched answer.
>
> Cheers,
> Paul
>
> On Tue, Jan 26, 2016 at 10:45 AM, Christian Beikov <christian.beikov_at_gmail.com> wrote:
>
> No I didn't mention this to the JPA spec lead yet. I wanted to create a POC first and get feedback from the Hibernate team before actually discussing standardization within JPA.
> As you already mentioned, there are many RDBMS vendors that simply don't or just partially support CTEs. At the moment the library fails with an exception if a feature that you use isn't supported by the RDBMS.
>
> I don't have full EclipseLink support yet but I'd be happy to implement it with some help.
>
> Regards,
> Christian
>
> Am 26.01.2016 um 13:34 schrieb Heiko Wagner:
>
> Hello Christian,
>
> thanks for your reply. Glad to hear that I am not the only one with this problem. Did you already approach the JPA spec lead/team, what they think about adding CTE query support to JPAQL? I know that current RDBMS support for CTEs strongly varies among the different vendors, which makes implementing a proper portable abstraction a real pain.
>
> I will take a closer look at your project soon. I am currently using EclipseLink. From the quick look at the github page, I am assuming there is also support for EclipseLink?
>
> Regards,
>
> Heiko
>
> Am 2016-01-26 12:36, schrieb Christian Beikov:
>
> Hello,
>
> I had the same problem as you did, missing support for CTEs.
> That's one reason why I created blaze-persistence[1 [1]] which implements support for CTEs for Hibernate.
>
> Hope this library can help you to ease your pain in the meantime until JPA gets these features.
>
> Regards,
> Christian
>
> [1] https://github.com/Blazebit/blaze-persistence [1]
>
> Am 26.01.2016 um 10:33 schrieb heiko.wagner_at_apis.de:
> Hi, I am currently working on a proof of concept Java SE application. I am using JPA for persintence, since I am faliliar with it from my Java EE project. I am trying to find out what would be a good solution to store directed acyclic object graphs. As far as I found out, there is no abstraction support for "CONNECT BY" / recursive CTEs in JPA. I could resort back to using native queries or drop JPA entirely in favour of a graph oriented db. Are there any condierations of providing support in JPA for this in the future?

-- 
Heiko Wagner - APIS Informationstechnologien GmbH
Gewerbepark A 13, 93086 Wörth a.d. Donau, Deutschland
Web: http://www.apis.de
E-Mail: heiko.wagner_at_apis.de
Tel.: +49 (0) 9482 - 9415 - 0
Fax: +49 (0) 9482 - 9415 - 25
Sitz der GmbH: Wörth/Donau, Amtsgericht Regensburg (HRB 6684)
Geschäftsführer: Julia Anna Dietz, Jürgen Eilers, Peter Rosenbeck
 
Links:
------
[1] https://github.com/Blazebit/blaze-persistence