Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ccarpenter04 opened this issue Oct 29, 2018 · 2 comments
Open

Comments

@ccarpenter04
Copy link

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 = ?).

@devender-yadav
Copy link
Contributor

Hi @ccarpenter04,

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

@ccarpenter04
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants