-
Notifications
You must be signed in to change notification settings - Fork 18
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
Not Able to access Id (auto generated field) post save operation #149
Comments
Hello, @bhishambajaj1999. |
Hello, @jchrys , Please find additional info. @id @column(name = "order_id", nullable = false) @column(name = "status", nullable = false) @column(name = "type", nullable = false) @column(name = "client_code", nullable = false) @column(name = "billing_code", nullable = false) @column(name = "pincode", nullable = false) @column(name = "address", columnDefinition = "json", nullable = false) @column(name = "lab_id") @column(name = "tenant_id", nullable = false) @column(name = "contact_no", nullable = false) @column(name = "contact_no_hashed", nullable = false) @column(name = "email_id") @column(name = "origin", columnDefinition = "json", nullable = false) @column(name = "referred_by", nullable = false) @column(name = "is_deleted", columnDefinition = "bit(1)", nullable = false) @column(name = "attributes", columnDefinition = "json", nullable = false) This is my R2dbcConfig @OverRide
} @bean @OverRide
} Sharing Reading convertor
} The requirement is to do operation on auto generated id, which I am not able to retrieve, but It is getting saved in database correctly. Currently I am handling this by explicitly calling
|
Hello, @bhishambajaj1999. |
return ordersRepository.save(orders)
.flatMap(savedOrder -> {
// Access the saved entity with the populated id
Long orderId = savedOrder.getId();
log.info("OrderId.....{}", orderId); // Getting null here..
}
@id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@column(name = "id", nullable = false)
private Long id;
mysql:
id
bigint NOT NULL AUTO_INCREMENT,The field is getting persisted correctly in database, but I am not able to access it.
The text was updated successfully, but these errors were encountered: