Impetus / kundera

A JPA 2.1 compliant Polyglot Object-Datastore Mapping Library for NoSQL Datastores.Please subscribe to:

Home Page:http://groups.google.com/group/kundera-discuss/subscribe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't query objects related with @JoinColumn with JPQL (Cassandra)

ccarpenter04 opened this issue · comments

JPQL queries structured similar to

SELECT f FROM Foo f WHERE f.bar.id = :barId

do not work properly, where bar is a field of Foo that is annotated with @joincolumn(name = "bar_id") and Bar is a class with a field named id.

The table is built correctly within the keyspace, however it appears that Kundera doesn't use the information available in the @joincolumn to resolve the proper column name when preparing a query that Cassandra can understand natively.

As a result of this, to get this functionality, we're having to resort to using datastore-dependent CQL queries when Cassandra is detected as the datastore in use (SELECT * From foo WHERE bar_id = ?).

Hi @ccarpenter04,

Can you please share more details about entities, Kundera & Cassandra version?

Kundera: 3.13
Cassandra: 3.11.3

The only interesting aspect of the entities is that they're related via the JoinColumn annotation. It seems like it fails to resolve the proper column name from the annotation when parsing the query, but that's anecdotal.