I have a strange problem. But first, 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 am using Hibernate / JPA. Everything works fine with HSQL and Derby, so my BO, DAO and unit tests should be fine. When testing with MySQL, I get this error:
org.springframework.dao.InvalidDataAccessResourceUsageException: cannot complete the request; SQL [select repeat0_.id as id8_, repeat0_.id_repeatType as id2_8_, repeat0_.id_trainingWrite as id3_8_ from repeat repeat00 _];
However change
<table name="repeat"/>
to
<table name="repeatt"/>
solves a problem with MySQL.
What's wrong? Is "repetition" a reserved keyword or is it a bug in the implementation of Hibernate JPA?
Thanks and greetings Er
java mysql orm hibernate jpa
Ta Sas Jul 10 2018-10-10T00: 00Z
source share