Hello,
After updating my database, my application has been displaying exceptions of type java.sql.SQLSyntaxErrorException .
The class below is the one it complains about, saying it does not exist when hibernate tries to create it.
@Entity
@Table(name="Loja")
public class Loja {
// Omitido para facilitar a leitura
}
This is my persistence.xml file:
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"
version="2.0">
<persistence-unit name="persistence_elysium">
<!-- provedor/implementacao do JPA -->
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<!-- dados da conexao -->
<property name="javax.persistence.jdbc.driver" value="com.mysql.cj.jdbc.Driver" />
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost/elysium?useTimezone=true&serverTimezone=UTC" />
<property name="javax.persistence.jdbc.user" value="pegasus" />
<property name="javax.persistence.jdbc.password" value="password" />
<!-- propriedades do hibernate -->
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5InnoDBDialect" />
<property name="hibernate.show_sql" value="false" />
<property name="hibernate.format_sql" value="false" />
<!-- atualiza o banco, gera as tabelas se for preciso -->
<property name="hibernate.hbm2ddl.auto" value="update" />
</properties>
</persistence-unit>
</persistence>
Enhancing, which started this problem when migrating to MySQL 8, in previous versions works normally (tested with version 5.7).
I also notice that I have updated mysql-connector, I tried the 8.0.11 and 8.0.12 versions of the jar.
I'm using Windows 10.
Tables are all created with lowercase letters, even if Table name is capitalized.
When it throws the exception, it says: Table 'elysium.loja' does not exist.
I will be very grateful to anyone who helps me to solve this problem, because this is getting me out of the serious .. rs.
Thank you!