Closed alessiofiore closed 1 year ago
I believe the "FETCH FIRST" clause isn't supported by Oracle 11g (But don't take my word for it, please check the Oracle Database documentation to confirm). If I'm right, then this would explain in the grammar exception.
Oracle R2DBC is not generating this SQL. My guess is that the Spring component would be doing this. Please check with the Spring developers about this.
Spring Data uses ANSI-style limit/offset clauses; See AnsiDialect
If you're using a database version that doesn't support that style, please subclass the OracleDialect
and provide a LimitClause
implementation that uses a syntax that is supported.
I hope this discussion was helpful. I'm going to close the issue as it seem to be a known issue that the Spring team is working on.
I'm using Spring Data R2DBC with Oracle 11g and I have the following error using method
findById
ofR2dbcCrudRepository
executeMany; bad SQL grammar [SELECT GAME_PHASE.* FROM GAME_PHASE WHERE GAME_PHASE.ID = :P0_id FETCH FIRST 2 ROWS ONLY]
This is the repository declaration
I don't understand why FETCH FIRST 2 ROWS ONLY is added to the query and it's the cause of problem.
I have the same problem writing the query using R2dbcEntityTemplate like below:
r2dbcEntityTemplate.selectOne(query(where("id").is(id)), GamePhase.class);
And these are the used dependancies: