-
Notifications
You must be signed in to change notification settings - Fork 131
Description
Given an entity with a structure roughly as follows:
@AllArgsConstructor
@NoArgsConstructor
@Data
final class SomeItem {
@Id
private String id;
private string someOtherField;
}
SomeItem si = new SomeItem('myCustomId','anotherField');
this.repository.save(si).block();
It doesn't appear that there is way to save an entity if the ID is pre-computed in Java land.
The exception looks like:
java.lang.IllegalStateException: Failed to execute ApplicationRunner at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:778) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE] at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:765) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:322) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE] at com.example.MyApplication.main(MyApplication.java:27) ~[classes/:na] Caused by: org.springframework.dao.TransientDataAccessResourceException: Failed to update table [example]. Row with Id [myCustomId] does not exist.
The backing Driver I'm working with is
<!-- R2DBC MySQL driver -->
<dependency>
<groupId>dev.miku</groupId>
<artifactId>r2dbc-mysql</artifactId>
<version>0.8.0.RELEASE</version>
</dependency>
Activity
mp911de commentedon Jan 31, 2020
That's a duplicate of #253 and #275.