-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
add class and field comments to entity generator #1952
add class and field comments to entity generator #1952
Conversation
{
"relationships": [
{
"relationshipId": 1,
"relationshipName": "complexJavadocRelationship",
"otherEntityName": "complexJavadocRelationship",
"relationshipType": "one-to-many",
"otherEntityRelationshipName": "complexJavadocEntity",
"javadoc": "<p>This class represents the Magna ligula pellentesque. Lacus ut sed. Himenaeos litora et posuere. Accumsan purus inceptos. Ultricies praesent metus. /* Fames odio quam. */</p><p>TODO:</p>\n\n<ul>\n<li>first über</li>\n<li>second</li>\n</ul>\n\nMake sure that json special characters like double quotes \" and backslashes \\ are escaped in json file and correctly displayed in javadoc"
}
],
"fields": [
{
"fieldId": 1,
"fieldName": "complexJavadocField",
"fieldType": "String",
"javadoc": "<p>This class represents the Magna ligula pellentesque. Lacus ut sed. Himenaeos litora et posuere. Accumsan purus inceptos. Ultricies praesent metus. /* Fames odio quam. */</p><p>TODO:</p>\n\n<ul>\n<li>first über</li>\n<li>second</li>\n</ul>\n\nMake sure that json special characters like double quotes \" and backslashes \\ are escaped in json file and correctly displayed in javadoc"
}
],
"changelogDate": "20150829194644",
"dto": "no",
"pagination": "no",
"javadoc": "<p>This class represents the Magna ligula pellentesque. Lacus ut sed. Himenaeos litora et posuere. Accumsan purus inceptos. Ultricies praesent metus. /* Fames odio quam. */</p><p>TODO:</p>\n\n<ul>\n<li>first über</li>\n<li>second</li>\n</ul>\n\nMake sure that json special characters like double quotes \" and backslashes \\ are escaped in json file and correctly displayed in javadoc"
} will generate /**
* <p>This class represents the Magna ligula pellentesque. Lacus ut sed.
* Himenaeos litora et posuere. Accumsan purus inceptos. Ultricies praesent
* metus. /* Fames odio quam. */</p><p>TODO:</p>
*
* <ul>
* <li>first über</li>
* <li>second</li>
* </ul>
*
* Make sure that json special characters like double quotes " and backslashes
* \ are escaped in json file and correctly displayd in javadoc
*/
@Entity
@Table(name = "COMPLEXJAVADOCENTITY")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class ComplexJavadocEntity implements Serializable {
...
/**
* <p>This class represents the Magna ligula pellentesque. Lacus ut sed.
* Himenaeos litora et posuere. Accumsan purus inceptos. Ultricies praesent
* metus. /* Fames odio quam. */</p><p>TODO:</p>
*
* <ul>
* <li>first über</li>
* <li>second</li>
* </ul>
*
* Make sure that json special characters like double quotes " and
* backslashes \ are escaped in json file and correctly displayd in javadoc
*/
@Column(name = "complex_javadoc_field")
private String complexJavadocField;
/**
* <p>This class represents the Magna ligula pellentesque. Lacus ut sed.
* Himenaeos litora et posuere. Accumsan purus inceptos. Ultricies praesent
* metus. /* Fames odio quam. */</p><p>TODO:</p>
*
* <ul>
* <li>first über</li>
* <li>second</li>
* </ul>
*
* Make sure that json special characters like double quotes " and
* backslashes \ are escaped in json file and correctly displayd in javadoc
*/
@OneToMany(mappedBy = "complexJavadocEntity")
@JsonIgnore
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
private Set<ComplexJavadocRelationship> complexJavadocRelationships = new HashSet<>();
...
} |
Awesome and they are optional right? May be we can add another quest in
|
It's fine by me. What do you sat @jdubois? This will lead to a lot more questioning but that is maybe no issue. |
Added wordwrap on javadoc comment. It wraps att 80 characters. Not sure what the standard wordwrap is used for jhipster. @jdubois you have any input on this? |
@andidev I don't want to have all those added questions, it's just going to be annoying most of the time. My opinion is that the class and field names should be clear enough, so that documenting them is useless (most of the time). I also believe clean coding names are the best documentation. |
Okey I have a look at intellijs default setting. @jdubois |
@andidev yes this would only be for JHipster UML, as it makes sense in this case to have the comments coming from the UML tool (this is in fact something I've done in the past, when I was using ArgoUML, probably around 2000 or 2001...) |
It would also be great to have these comments fill the swagger doc. |
@cbornet unfortunately I have no swagger skills 😢 |
@andidev You can use |
Did not find a way to deal with swagger. Jhipster UML seems to be done with their work on their side. We should either merge this or close this PR. Are there any doubts on merging this @jdubois? |
3a4f2fe
to
e16a911
Compare
relates to jhipster/jhipster-um#46 fix jhipster#1949
e16a911
to
26d5dd1
Compare
Fixed merge conflict so it should be mergable now |
…-entity-generator add class and field comments to entity generator
relates to jhipster/jhipster-uml#46
fix #1949