Harish Amarnath Harish Amarnath - 7 months ago 32
Java Question

Exception in thread "main" org.hibernate.exception.SQLGrammarException: ORA-00926: missing VALUES keyword

kindly ignore this,,,
this post is supposed to be deleted.

Answer

The problem in the SQL is that the minus sign in the table name "COLLECTION-TABLE" is not a valid character in an unquoted identifier.

Is suspect that this:

  @JoinTable(name="COLLECTION-TABLE")

should really be this:

  @JoinTable(name="COLLECTION_TABLE")

If you really want a minus sign in your table name (crazy!) then you need to include the (suitably escaped) quote characters in the names. Like this for Oracle:

  @JoinTable(name="\"COLLECTION-TABLE\"")

Reference: https://docs.jboss.org/hibernate/orm/3.6/reference/en-US/html/mapping.html#mapping-quotedidentifiers