-
Notifications
You must be signed in to change notification settings - Fork 0
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
Create advertisement #119
Create advertisement #119
Conversation
This reverts commit 4288276.
private void initializeAdStatus() { | ||
if (this.adStatus == null) { | ||
this.adStatus = AdvertisementStatusRepositoryHolder.getRepository() | ||
.findById(1L) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is risky to depend on a specific ID; it is better to use find by status name, which also makes the code easier to understand. Moreover, if this is critical, you can also create the required status if it has not been done yet.
Finally, if done with a PrePersist and the Handler is not required (note it is Handler, not Holder), the Handler can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, make the code less dependant on a particular status id as detailed in the corresponding comment
Solved |
No description provided.