-
Notifications
You must be signed in to change notification settings - Fork 29
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
Restrict Clan creation #108
Comments
What exactly happens? Maybe we can handle adding the clan leader by adding a |
We have a invalid clan... I think the validation will fail... The elide annotations looks new... Did you test them? Because jpa annotation have some restrictions http://www.objectdb.com/java/jpa/persistence/event e. G. Is it not allowed to use an Entity manager or Query. |
No I did not test it, I just saw it in the docs. You can't have a clan without a clan leader and you can't have a clan leader without a clan. I see no problem there. Furthermore even if it against the REST principle, moving it to a controller URL does not change anything about the semantics. |
The clan leader is not the problem... The clan leader must be member of a clan and every clan need at least one member... The validation of the clan will fail because no members exists and you can not add members because the clan doesn't exist |
Yeah so? That is a basic problem with referential integrity across all databases and need to be done inside a transaction. Sounds like a job for |
Any idea how I can get the player and clan repository? It looks like a bad idea to include the repository in every entitiy ... Test Branch https://github.com/FAForever/faf-java-api/tree/feature/108-clan-commit |
After intense research I come to the conclusion that the Elide extensions are not suited for this use case. We could use Hibernate's extensions like PreCommit instead. |
Using Hibernate entity listeners works and I will move clan creation back to the Elide route. See #362 |
It should not be possible to create Clan Entities over the JSON API.
Instead the
ClanController
should be used ...https://github.com/FAForever/faf-java-api/blob/develop/src/main/java/com/faforever/api/clan/ClansController.java#L59
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: