1
Hello,
After updating my database, my application has been presenting exceptions, like java.sql.Sqlsyntaxerrorexception.
The class below is the one he complains about, saying it doesn’t 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>
Reinforcing, that started this problem when migrating to Mysql 8, in previous versions works normally (tested with version 5.7).
I also note that I updated mysql-Connector, tried 8.0.11 and 8.0.12 versions of jar.
I’m using Windows 10.
Tables are created all in minute letters, even if Table name is capitalized.
When he launches Exception, he says: Table 'Elysium.store' does not exist.
I will be very grateful to anyone who helps me to solve this problem, because it is taking me seriously.. rs.
Thank you!
Was database created before running? JPA only creates tables, database does not.
– Gnk