-
-
Notifications
You must be signed in to change notification settings - Fork 99
Fix the UndeclaredEntityException message when not providing a relationship name #172
Comments
Hello, you actually have to declare A |
I know that. This was intentional. Like I said, look at the message: "In the association A_blabla_to_B_null, the entity A is not declared." |
Oh, sorry then! I'll have a look in a few minutes. |
I don't think you use v1.6.4 of JHipster-UML... this message was replaced by: Now for the error, I suggest you read the "Managing Relationships" page in the doc. I'll keep this thread open if you want help getting the last version, I know this can be very painful! |
Please look at https://github.com/jhipster/jhipster-uml/blob/master/lib/dsl/dsl_parser.js#L233 |
Too tired to see the real problem, sorry. The stacktrace was made so that we analyze it, even the ID is working for us here. |
Took me a real long time to understand what you wanted... now for the really long explanation: you don't have IDs in the JDL because we don't need to identify objects in the JDL file. However, we need them to access objects later in the generation process. If a user has an error, this message will tell us the nature of the relationship and how it was created. That's completely normal. Again, sorry to have taken such a long time to correctly understand you. |
Hehehe... Maybe I'm being too laconic, sorry. jhipster-uml is correct when it throws the It's stupid, I know... Take a look at https://github.com/jhipster/jhipster-uml/blob/master/lib/dsl/dsl_parser.js#L49 |
You're not. But it's actually really difficult for people to understand one another when not communicating face to face. I'll see what I can do about it sometime after at least ten hours of sleep and a nice cup of tea. |
The new error message: |
The message just below should not be changed too? |
Oh. I didn't see it at all. Thanks! |
Merged the checks/throws into one: var absentEntities = [];
if (!this.parsedData.getClass(association.from.name)) {
absentEntities.push(association.from.name);
}
if (!this.parsedData.getClass(association.to.name)) {
absentEntities.push(association.to.name);
}
if (absentEntities.length !== 0) {
throw new UndeclaredEntityException(
'In the relationship between '
+ association.from.name
+ ' and '
+ association.to.name
+ ', '
+ absentEntities.join(' and ')
+ (absentEntities.length === 1 ? ' is' : ' are')
+ ' not declared.'
);
} |
The issue
Look at the
A_blabla_to_B_null
part in the stacktrace.Better to remove the
_
as separator too and use brackets.The stacktrace
The XMI or JDL file
Versions
2.27.2
1.6.4
The text was updated successfully, but these errors were encountered: