starnowski / posmulten-hibernate

Integration of Posmulten and Hibernate libraries
GNU Lesser General Public License v2.1
3 stars 0 forks source link

Add option to disable adding of constraint that checks if foreign keys belong to the same tenant #10

Closed starnowski closed 2 years ago

starnowski commented 2 years ago

Add option to disable adding of constraint that checks if foreign keys belong to the same tenant.

In addition, add a new integration test with model entities whose part of the primary key is tenant identifier. In such a case the constraint that checks if foreign keys belong to the same tenant is redundant.

Useful links on how to map composite key and reference to the already existing column: https://stackoverflow.com/questions/32625410/hibernate-foreign-key-with-a-part-of-composite-primary-key https://stackoverflow.com/questions/25236449/understanding-mapsid-annotation-in-hibernate#:~:text=As%20per%20Hibernate%20documentation%2C%20the%20explanation%20for%20%40MapsId,association%20in%20the%20entity%20via%20the%20%40MapsId%20annotation.