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.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I might have stumbled on a little peculiarity (maybe a bug). If we have an aggregate which does not contain any fields annotated with @Column but does contain an ID field and possibly some one-to-one relations to some other entity, like this:
Then we can insert this aggregate OK, but we cannot update it (say by specifying a new value for a relation). For example:
StringfoobarId = UUID.randomUUID().toString();
// this worksjdbcAggregateTemplate.insert(newFoobar(foobarId, newWambaz("wam")));
// this will give an errorjdbcAggregateTemplate.update(newFoobar(foobarId, newWambaz("baz")));
Here is the typical error:
Caused by: org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [UPDATE "foobar" WHERE "foobar"."id" = ?]; nested exception is org.postgresql.util.PSQLException: ERROR: syntax error at or near "WHERE"
I've checked it with Spring Data JDBC v. 2.4.2 (from spring-boot-starter-data-jdbc v. 2.7.2) and Postgres database.
Thank you for your attention and you work in this excellent framework.
George
The text was updated successfully, but these errors were encountered:
Uh oh!
There was an error while loading. Please reload this page.
Hello Spring Data JDBC team,
I might have stumbled on a little peculiarity (maybe a bug). If we have an aggregate which does not contain any fields annotated with
@Column
but does contain an ID field and possibly some one-to-one relations to some other entity, like this:Then we can insert this aggregate OK, but we cannot update it (say by specifying a new value for a relation). For example:
Here is the typical error:
I've checked it with Spring Data JDBC v. 2.4.2 (from
spring-boot-starter-data-jdbc
v. 2.7.2) and Postgres database.Thank you for your attention and you work in this excellent framework.
George
The text was updated successfully, but these errors were encountered: