Spring Boot pt. 25: Relational Mappings @ManyToMany (3/3)
25 days ago
1
SQL Queries:
CREATE TABLE customer_address (
customer_id BIGINT,
address_id BIGINT,
PRIMARY KEY (customer_id, address_id),
FOREIGN KEY (customer_id) REFERENCES customer(id),
FOREIGN KEY (address_id) REFERENCES address(id)
);
INSERT INTO customer_address (customer_id, address_id)
SELECT customer_id, id as address_id
FROM address;
ALTER TABLE address
DROP FOREIGN KEY fk_customer;
ALTER TABLE address
DROP COLUMN customer_id;
In today's No BS Guide to Java Spring Boot, we finish Relational Mappings by using the @ManyToMany annotation, creating a Junction table, upholding the previous relationship of @OneToMany. We also use @JSONIGNORE to deal with a circle reference.
LinkTree:
https://linktr.ee/peachezprogramming
Loading comments...
-
LIVE
vivafrei
57 minutes ago4th of July Fishing with Viva! Baldwin Trial UPCOMING! Trump Causing MELTDOWNS! And MORE!
1,314 watching -
13:32
TENET Media
48 minutes agoThe Left DEFEATED in France | Lauren Southern
2 -
23:14
DepressedGinger
4 hours ago*SHOCKER* Hunter & Joe tell Dems to F*** Off, want to stay in race
1341 -
2:30:23
Kim Iversen
3 hours agoDocumentary Showing: Israel's Second 9/11, How Zionism Conquered JFK, America & Palestine
25K68 -
1:46
LimitlessAmbition
2 hours agoThe REAL Reason America Celebrates 4th of July
23 -
2:04:12
Robert Gouveia
4 hours agoKarine LIED about Joe's Condition; Biden THREATENS Media; Trump ROASTS Kamala
14.8K53 -
1:05:25
Russell Brand
5 hours agoTRUMP'S SHOCKING LEAK: Biden Destroyed | UK Elections: Just a New Face for Globalism? - SF 400
122K296 -
2:01:42
LFA TV
6 hours ago4TH OF JULY SPECIAL! | LIVE FROM AMERICA 7/4/2024 11am est
58.7K85 -
2:02:15
TheAlecLaceShow
5 hours agoGuests: Dr. Eithan Haim | Sheriff Richard Mack | Biden Stays In | Dems In Panic | The Alec Lace Show
13.4K4 -
57:19
TheMonicaCrowleyPodcast
4 hours agoThe Monica Crowley Podcast: Independence Day Fireworks
21.7K13