blaze-persistence icon indicating copy to clipboard operation
blaze-persistence copied to clipboard

Reserved keywords error returns a cryptic message.

Open desesseint opened this issue 4 years ago • 1 comments

If you use a reserved keyword in the get method of entity views, the program won't work and you'll get a cryptic error message: "Probably we did something wrong, please contact us if you see this message.". E.g. :

  1. getReturn()
  2. getBreak()
  3. etc.

I don't know what this qualifies as, but the error message could be better.

desesseint avatar Dec 06 '21 12:12 desesseint

Hi and thanks for the report.

We generate fields with the attribute names i.e. for getReturn the attribute name is return which is a keyword, so that fails at some point. You could workaround this by using a different method name for mappings e.g. getReturnString and create a default method default String getReturn() { return getReturnString(); } to expose the method that you want.

We can certainly fix this, but this introduces some indirections or name replacement which will make the code more complex, so this does not have a high priority for us at this moment. I do agree though, that the error could be better, something like "Java keywords as attribute names are not supported". I guess your desire is to improve the error message?

beikov avatar Dec 06 '21 13:12 beikov