Using Spring webflux with H2-R2DBC and creating a course by adding the details in course table defined as below.
CREATE TABLE IF NOT EXISTS course(
id VARCHAR(40) PRIMARY KEY,
name VARCHAR(40) NOT NULL,
fee DECIMAL,
updatedtime TIMESTAMP DEFAULT CURRENT_TIMESTMP);
Using ReactiveCrudRepository save method to save the data like below
Course course=new Course();
course.setName("Physics");
course.setId("PHY123");
course.fee(100);
repository.save(course);
as per logs in webflux on save the object is having null for updatedtime.
Question :-
- How to avoid setting null and set default value as current timestamp on each insert/update.
- How to use @Column(name="updatedtime",insertable=false) in Spring Webflux.