Quote:
Many (Event) to One (Project) is best done by @ManyToOne on the child side. How do you determine which is the child? (I'm guessing it has to be the many (Event)).
It's very easy to determine which one is the child side in a one-to-one or one-to-many association. If you look at the database tables, the table that has the FK (e.g. Event) and cannot live without its parent (e.g. Project) is a child.
So, can you have an Event without a Parent? Well, even if you can, can you have multiple Projects assigned to an Event or multiple Events assigned to a Project? The many side distates the child side, hence the placement of the FK.
Quote:
Then the article goes on to say in order to make it bidrectional and be able to get the Project associated with a given Event you need to setup a JPQL query to get the Project?
Nope. Bidirectional means that you can navigate the association both ways. However, you can also use a JPQL query for the parent side. It's not like you always have to use bidirectional associations.