Relative Content

Tag Archive for javaspringpostgresqljpa

How to persist object with ManyToOne field in JPA?

Having trouble understanding/ persisting a Listing record in my postgresql db through jpa. The Listing model is related to User by ManyToOne. Assuming the user is already created before hand, I want to save a Listing record and include the existing user inside.