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

Javers and SQL Server #796

Closed
Pinellus opened this Issue Feb 26, 2019 · 4 comments

Comments

Projects
None yet
2 participants
@Pinellus
Copy link

Pinellus commented Feb 26, 2019

Hi,
with a QueryBuilder.byInstanceId, I get a SQL Exception on SQL Server:

SQL_EXCEPTION: An expression of non-boolean type specified in a context where a condition is expected, near 'ORDER'.
while executing sql:     SELECT state, type, version, changed_properties, managed_type, commit_pk, author, commit_date, commit_date_instant, commit_id, g.local_id, g.fragment, g.owner_id_fk, o.local_id owner_local_id, o.fragment owner_fragment, o.type_name owner_type_name FROM jv_snapshot INNER JOIN jv_commit ON commit_pk = commit_fk INNER JOIN jv_global_id g ON g.global_id_pk = global_id_fk LEFT OUTER JOIN jv_global_id o ON o.global_id_pk = g.owner_id_fk WHERE 1 = 1 and (  false) ORDER BY snapshot_pk DESC OFFSET ? ROWS FETCH NEXT ? ROWS ONLY

Can you help me?
Regards

@Pinellus

This comment has been minimized.

Copy link
Author

Pinellus commented Feb 26, 2019

In depth:

Changes changes = javers.findChanges(QueryBuilder.byInstanceId(MyPK, MyClass.class).build() );

Here the JDBC PreparedStatement return a "WHERE 1 = 1 and ( false)" that is not compatibile with SQL Server

@bartoszwalacik

This comment has been minimized.

Copy link
Member

bartoszwalacik commented Feb 27, 2019

OK, l try to fix it, which is not easy because I don't have Oracle database at my fingertips.

@bartoszwalacik

This comment has been minimized.

Copy link
Member

bartoszwalacik commented Mar 11, 2019

@bartoszwalacik

This comment has been minimized.

Copy link
Member

bartoszwalacik commented Mar 12, 2019

fix is released
5.2.6
https://search.maven.org/search?q=javers-core
check it out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.