PicnicSupermarket / jolo

jOOQ entity relationship loader.
MIT License
46 stars 4 forks source link

Non-foreign key relationships #7

Open jadeleeuw opened 5 years ago

jadeleeuw commented 5 years ago

It seems that it is currently not possible in JOLO to describe a relationship where one of the fields in a table is from another table but is not actually a foreign key. Could this functionality be added?

Use case:

Imagine that you have a table that serves as a log which records all events that have happend. The events in this events table contain an ID of an instance of Foo from the Foo table. Foos can be deleted later on, but the events still have a reference to these Foos which now no longer exist. The reason for not using a foreign key in this case is that since the table serves as a log the events of non-existing Foos should remain in the table and not be deleted if the corresponding Foo is deleted.