0

我有以下休眠配置:

<bean id="SessionFactory" class="org.springframework.orm.hibernate4.LocalSessionFactoryBean">
        <property name="dataSource" ref="DataSource" />
        <property name="annotatedClasses">
            <list>
            <value>com.google.hacatone.entity.MainCategory</value>
            <value>com.google.hacatone.entity.GeorgianGrapes</value>
            </list>
        </property>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</prop>
                <prop key="hibernate.hbm2ddl.auto">validate</prop>
                <prop key="hibernate.show_sql">true</prop>
            </props>
        </property>
    </bean>

当我尝试从表中选择数据时,出现以下错误:

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 'georgiangr0_' at line 1

请帮助我如何解决这个问题,我尝试使用任何 mysql 驱动程序但问题没有改变

@Entity
@Table(name = "main_category", catalog = "hacatone_db")
public class MainCategory implements java.io.Serializable {
}

@Entity
@Table(name = "georgian_ grapes", catalog = "hacatone_db")
public class GeorgianGrapes implements java.io.Serializable {
}

这是我的实体,如何强制休眠生成正确的查询?

4

0 回答 0