-
Notifications
You must be signed in to change notification settings - Fork 22
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
Rename model.Entity class #35
Comments
this class bugs me. I am thinking to remove this class and put id, equals and hashCode in the generated model. Someone does not agree? |
I think the model.Entity or wherever is the name is good to restric the Generic type like GenericFoo and useful to reuse the code as usual. I tried the name as AbstractEntity, but the dom4j has this classe name too. |
Another thing that makes me thinking remove this class is that the generated method equals has a critical bug when using hibernate. |
I always use instance of and think we should use it. But I prefer to leave the implementation of equals and hashCode within the specialized class, because the developer will decide what makes their class equals. I know we can override the methods and adapt them to individual needs, but it forces all class have already implemented these methods even if I don't want. |
it's a good point @wbotelhos I will create some option in scaffold command to create equals or to skip it. |
Cool! I prefer the second option. |
I always use Entity class to add more attributes like created_at, updated_at, .... So I prefer the second option too. |
The class model.Entity can be confused with javax.persistence.Entity
The text was updated successfully, but these errors were encountered: