2
need to make a relationship between three tables in the database in Java, created the two entities and the methods of the two entities, now need to insert a relationship table that has only two fields and each of them referencing the respective entities, someone has an idea how to do this?
Project Photo
Photo from the database
In terms of Postgresql you resolve with CREATE TABLE and the FOREIGN KEY clause. https://www.postgresql.org/docs/current/sql-createtable.html
– anonimo
I want to do in java
– A. Carlos
Do in java, you say Hibernate?
– Erick Luz
Yes, do in Ibernate!
– A. Carlos
@A.Carlos , do you understand that when you work with Hibernate, you don’t need to create the tables inside the database? this image is from your database?
– Erick Luz
Yes, that photo is from my database
– A. Carlos
@A.Carlos can insert its model classes?
– Erick Luz
I can, I just don’t know how
– A. Carlos
@A.Carlos Puts as source code the two classes
– Erick Luz