I'm trying to model the following 1-to-many relationship:
Code:
Class 1:
UserAccount
accountID
...
AccountLog
logID
accountID
...
AccountLog's accountID refers to UserAccount's accountID.
At first, I thought of modeling this as a parent-child relationship (ala the Hibernate user guide example), since I want UserAccount to manage the lifecycle of AccountLogs (removing a UserAccount should remove all logs referencing that account).
The thing, though, is that I don't want to have an accountLogs property in UserAccount. In fact, I don't want UserAccount to have any knowledge at all about AccountLogs.
Is there a way to establish this "parent/child"-kind of relationship without having to declare a property for AccountLogs in UserAccount? (I'm relatively new to Hibernate, so I apologize if this question was already discussed.)