Search code examples
javaglassfishejbejb-2.xcmp

'Order' entity bean


My database has a table name Order. When I create a new CMP Entity bean, NetBeans 6.9.1 automatically generated a bean with 3 classes name:

  • Order1.java
  • Order1Local.java
  • Order1LocalHome.java

I tried to rename those 3 classes to Order without the 1. I've already edit the ejb-jar.xml file. However, I got this error when deploying the project:

JDO7704: This error (In DatabaseGenerator, failed to get 'relClassName' for 'order') should not occur

I also tried the name OrderBean but it only works with Order1. What should I do to rename my entity bean to Order.


Solution

  • Order is a reserved word in some dbms (used in order by expressions). Maybe that is the reason why Netbeans adds the 1. You should name your table different.

    Just found this useful tool: SQL Reserved Words Checker. It says that Order is not reserved in ISO/ANSI,SQL99 but in dbms like DB2 or Oracle.