I am having a strange problem. But first the orm.xml:
<entity class="de.test.businessobjects.Repeat">
<table name="repeat"/>
<attributes>
<id name="id">
<generated-value strategy="TABLE"/>
</id>
<many-to-one name="repeatType" fetch="LAZY">
<join-column name="id_repeatType"/>
</many-to-one>
<many-to-one name="trainingSet" fetch="LAZY">
<join-column name="id_trainingSet"/>
</many-to-one>
</attributes>
</entity>
I use Hibernate / JPA. Everything runs fine with HSQL and Derby, so my BO, DAO and unit tests must be ok. When testing with MySQL, I get this error:
org.springframework.dao.InvalidDataAccessResourceUsageException:
could not execute query; SQL [select
repeat0_.id as id8_,
repeat0_.id_repeatType as id2_8_,
repeat0_.id_trainingSet as id3_8_ from
repeat repeat0_];
However, changing
<table name="repeat"/>
to
<table name="repeatt"/>
solves the problem with MySQL.
What is wrong? Is "repeat" a reserved keyword or is this a bug in Hibernate's JPA implementation?
Thank & Cheers
Er
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…