[
https://issues.jboss.org/browse/FORGE-451?page=com.atlassian.jira.plugin....
]
Lincoln Baxter III commented on FORGE-451:
------------------------------------------
Perhaps we should ask if the user wants Forge to generate these methods for them? I
believe we have this capability already, we could extend it for existing entities, not
just new ones?
In EntityPlugin.java we have:
{code}
private void createHashCodeAndEquals(final JavaClass javaClass)
{
javaClass.addMethod(
"public boolean equals(Object that) { " +
"if (this == that) { return true; } " +
"if (that == null) { return false; } " +
"if (getClass() != that.getClass()) { return false; } "
+
"if (id != null) { return id.equals((("
+ javaClass.getName() + ") that).id); } " +
"return super.equals(that); " +
"}")
.addAnnotation(Override.class);
javaClass.addMethod(
"public int hashCode() { " +
"if (id != null) { return id.hashCode(); } " +
"return super.hashCode(); }")
.addAnnotation(Override.class);
}{code}
Warn a user if generating relationship CRUD screens and
HashCode/Equals are missing
-----------------------------------------------------------------------------------
Key: FORGE-451
URL:
https://issues.jboss.org/browse/FORGE-451
Project: Forge
Issue Type: Feature Request
Components: Scaffold
Reporter: Pete Muir
Assignee: Richard Kennard
It's necessary to provide these on the entities in order for drop downs to work. If
not provided, there should be a WARN message.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see:
http://www.atlassian.com/software/jira