DiscussionComment entity has Oracle reserved word as a column causing database generation error

58 views Asked by At

When I try to use the stereotype DISCUSSION with Oracle I get an error because of the entity DiscussionComment column named "comment". Although I'm using the correct dialect for my Oracle version, Hibernate is not quoting DDL as needed. This is a very common problem with simple solution. I just want to apply the solution to OpenXava.

I tried to change the DiscussionComment source in OpenXava project (the one that comes with the OpenXava IDE). I changed the column name but it had no effect.

What and where should I change to alter the mapping of the entity?

The same problem applies to "YourFirstEntity", the demo entity of every project because of the "date" column.

2

There are 2 answers

0
javierpaniza On BEST ANSWER

Add the property hibernate.globally_quoted_identifiers to true in your persistence unit in persistence.xml

0
Gustavo On

To modify OpenXava Java code, XML or i18n files:

  • Modify the code on OpenXava/src, OpenXava/xava or OpenXava/i18n.

  • Execute the Ant target buildOpenXava from OpenXava/build.xml. It compiles the OpenXava Java code and creates openxava.jar.

  • Refresh OpenXava project in Eclipse (F5).

  • Execute the Ant target updateOX from the build.xml of your own project.

  • Refresh your own project in Eclipse (F5).

reference: https://openxava.org/OpenXavaDoc/docs/modify-openxava-code_en.html

Credits to @javierpaniza