I am trying to create a simple example for saving a object with two fields (MySQL 5) of which one is an ID. I defined the following in the HBM.XML
Code:
<id name="Index" type="long">
<column name="INDEX" unique="true" length="20" />
<generator class="increment" />
</id>
and the corresponding SQL that is generated by the org.hibernate.dialect.HSQLDialect is
Code:
select
max(INDEX)
from
table1
which does not runs successfully even in MySQL query browser. I am getting exception
Code:
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INDEX)
I am not sure what is a miss here.
- Samarthya