Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make AccountAccess an Associative Class without own Identity #12

Open
christophknabe opened this issue Jan 28, 2018 · 0 comments
Open

Comments

@christophknabe
Copy link
Owner

AccountAccess is intended as an associative class, that is a materialization of an association between Client and Account. The meaning is: The Client has the right to manage the Account. The associative class is necessary, as the association "Client can manage Account" has an attribute which states, if the Client is the owner of the Account, or only a manager.
It was quickly implemented as a subclass of EntityBase<AccountAccess>. As an undesired consequence the associative class has an own ID. This implies, that the persistence would tolerate several links between a Client and an Account, even with contradictory values of the attribute isOwner. This is certainly not desirable.
A better solution would be to make the associative class have a primary key composed of the Client and the Account linked together. How to accomplish this with JPA has to be found out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant