Linked Questions

Popular Questions

Why does Spring-data-jdbc not save my Car object?

Asked by At

I'm playing around with spring-data-jdbc and discovered a problem, with I can't solve using Google.

No matter what I try to do, I just can't push a trivial object into the database (Bean1.java:25): carRepository.save(new Car(2L, "BMW", "5"));

Both, without one and with a TransactionManager +@Transactional the database (apparently) does not commit the record.

The code is based on a Postgres database, but you might also simply use a H2 below and get the same result.

Here is the (minimalistic) source code: https://github.com/bitmagier/spring-data-jdbc-sandbox/tree/stackoverflow-question

Can somebody tell me, why the car is not inserted into the database?

Related Questions