lvbarbosa 12 de jun. de 2017
Declarou Automovel como entidade no persistence.xml?
tucupi 13 de jun. de 2017
não declarei na apostila que to lendo não tem isso.
como faria ?
meu arquivo xml
<?xml version="1.0" encoding="UTF-8"?>
<persistence version= "2.0"
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
" >
<persistence-unit name= "default" >
<properties>
<property name= "javax.persistence.jdbc.url" value= "jdbc:mysql://localhost/teste" />
<property name= "javax.persistence.jdbc.user" value= "root" />
<property name= "javax.persistence.jdbc.password" value= "senha" />
<property name= "javax.persistence.jdbc.driver" value= "com.mysql.jdbc.Driver" />
<property name= "hibernate.dialect" value= "org.hibernate.dialect.MySQLInnoDBDialect" />
<property name= "hibernate.hbm2ddl.auto" value= "update" />
</properties>
</persistence-unit>
</persistence>
lvbarbosa 13 de jun. de 2017
Dentro da tag persistence-unit (no mesmo nível da tag properties), coloca:
<class> estudo.com.br.bean.Automovel</class>
tucupi 13 de jun. de 2017
acabei de fazer isso agora gera o seguinte erro.
jun 13 , 2017 11 : 34 : 19 AM org . hibernate . jpa . internal . util . LogHelper logPersistenceUnitInformation
INFO : HHH000204 : Processing PersistenceUnitInfo [
name : default
...]
jun 13 , 2017 11 : 34 : 20 AM org . hibernate . Version logVersion
INFO : HHH000412 : Hibernate Core { 5.2.10 . Final }
jun 13 , 2017 11 : 34 : 20 AM org . hibernate . cfg . Environment < clinit >
INFO : HHH000206 : hibernate . properties not found
jun 13 , 2017 11 : 34 : 20 AM org . hibernate . annotations . common . reflection . java . JavaReflectionManager < clinit >
INFO : HCANN000001 : Hibernate Commons Annotations { 5.0.1 . Final }
jun 13 , 2017 11 : 34 : 21 AM org . hibernate . engine . jdbc . connections . internal . DriverManagerConnectionProviderImpl configure
WARN : HHH10001002 : Using Hibernate built - in connection pool ( not for production use ! )
jun 13 , 2017 11 : 34 : 21 AM org . hibernate . engine . jdbc . connections . internal . DriverManagerConnectionProviderImpl buildCreator
INFO : HHH10001005 : using driver [ com . mysql . jdbc . Driver ] at URL [ jdbc : mysql : //localhost/teste]
jun 13 , 2017 11 : 34 : 21 AM org . hibernate . engine . jdbc . connections . internal . DriverManagerConnectionProviderImpl buildCreator
INFO : HHH10001001 : Connection properties : { user = root , password =**** }
jun 13 , 2017 11 : 34 : 21 AM org . hibernate . engine . jdbc . connections . internal . DriverManagerConnectionProviderImpl buildCreator
INFO : HHH10001003 : Autocommit mode : false
jun 13 , 2017 11 : 34 : 21 AM org . hibernate . engine . jdbc . connections . internal . PooledConnections < init >
INFO : HHH000115 : Hibernate connection pool size : 20 ( min = 1 )
Tue Jun 13 11 : 34 : 24 BRT 2017 WARN : Establishing SSL connection without server ' s identity verification is not recommended . According to MySQL 5.5.45 + , 5.6.26 + and 5.7.6 + requirements SSL connection must be established by default if explicit option isn ' t set . For compliance with existing applications not using SSL the verifyServerCertificate property is set to ' false ' . You need either to explicitly disable SSL by setting useSSL = false , or set useSSL = true and provide truststore for server certificate verification .
jun 13 , 2017 11 : 34 : 25 AM org . hibernate . dialect . Dialect < init >
INFO : HHH000400 : Using dialect : org . hibernate . dialect . MySQLInnoDBDialect
jun 13 , 2017 11 : 34 : 27 AM org . hibernate . resource . transaction . backend . jdbc . internal . DdlTransactionIsolatorNonJtaImpl getIsolatedConnection
INFO : HHH10001501 : Connection obtained from JdbcConnectionAccess [ org . hibernate . engine . jdbc . env . internal . JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess @2 a898881 ] for ( non - JTA ) DDL execution was not in auto - commit mode ; the Connection ' local transaction ' will be committed and the Connection will be set into auto - commit mode .
jun 13 , 2017 11 : 34 : 28 AM org . hibernate . resource . transaction . backend . jdbc . internal . DdlTransactionIsolatorNonJtaImpl getIsolatedConnection
INFO : HHH10001501 : Connection obtained from JdbcConnectionAccess [ org . hibernate . engine . jdbc . env . internal . JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess @635572 a7 ] for ( non - JTA ) DDL execution was not in auto - commit mode ; the Connection ' local transaction ' will be committed and the Connection will be set into auto - commit mode .
jun 13 , 2017 11 : 34 : 28 AM org . hibernate . tool . schema . internal . ExceptionHandlerLoggedImpl handleException
WARN : GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement
org . hibernate . tool . schema . spi . CommandAcceptanceException : Error executing DDL via JDBC Statement
at org . hibernate . tool . schema . internal . exec . GenerationTargetToDatabase . accept ( GenerationTargetToDatabase . java : 67 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . applySqlString ( SchemaCreatorImpl . java : 440 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . applySqlStrings ( SchemaCreatorImpl . java : 424 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . createFromMetadata ( SchemaCreatorImpl . java : 315 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . performCreation ( SchemaCreatorImpl . java : 166 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . doCreation ( SchemaCreatorImpl . java : 135 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . doCreation ( SchemaCreatorImpl . java : 121 )
at org . hibernate . tool . schema . spi . SchemaManagementToolCoordinator . performDatabaseAction ( SchemaManagementToolCoordinator . java : 155 )
at org . hibernate . tool . schema . spi . SchemaManagementToolCoordinator . process ( SchemaManagementToolCoordinator . java : 72 )
at org . hibernate . internal . SessionFactoryImpl . < init > ( SessionFactoryImpl . java : 309 )
at org . hibernate . boot . internal . SessionFactoryBuilderImpl . build ( SessionFactoryBuilderImpl . java : 452 )
at org . hibernate . jpa . boot . internal . EntityManagerFactoryBuilderImpl . build ( EntityManagerFactoryBuilderImpl . java : 889 )
at org . hibernate . jpa . HibernatePersistenceProvider . createEntityManagerFactory ( HibernatePersistenceProvider . java : 58 )
at javax . persistence . Persistence . createEntityManagerFactory ( Persistence . java : 55 )
at javax . persistence . Persistence . createEntityManagerFactory ( Persistence . java : 39 )
at PersistenceAutomovel . main ( PersistenceAutomovel . java : 11 )
Caused by : 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 ' type = InnoDB ' at line 1
at sun . reflect . NativeConstructorAccessorImpl . newInstance0 ( Native Method )
at sun . reflect . NativeConstructorAccessorImpl . newInstance ( Unknown Source )
at sun . reflect . DelegatingConstructorAccessorImpl . newInstance ( Unknown Source )
at java . lang . reflect . Constructor . newInstance ( Unknown Source )
at com . mysql . jdbc . Util . handleNewInstance ( Util . java : 425 )
at com . mysql . jdbc . Util . getInstance ( Util . java : 408 )
at com . mysql . jdbc . SQLError . createSQLException ( SQLError . java : 943 )
at com . mysql . jdbc . MysqlIO . checkErrorPacket ( MysqlIO . java : 3973 )
at com . mysql . jdbc . MysqlIO . checkErrorPacket ( MysqlIO . java : 3909 )
at com . mysql . jdbc . MysqlIO . sendCommand ( MysqlIO . java : 2527 )
at com . mysql . jdbc . MysqlIO . sqlQueryDirect ( MysqlIO . java : 2680 )
at com . mysql . jdbc . ConnectionImpl . execSQL ( ConnectionImpl . java : 2486 )
at com . mysql . jdbc . ConnectionImpl . execSQL ( ConnectionImpl . java : 2444 )
at com . mysql . jdbc . StatementImpl . executeInternal ( StatementImpl . java : 845 )
at com . mysql . jdbc . StatementImpl . execute ( StatementImpl . java : 745 )
at org . hibernate . tool . schema . internal . exec . GenerationTargetToDatabase . accept ( GenerationTargetToDatabase . java : 54 )
... 15 more
jun 13 , 2017 11 : 34 : 28 AM org . hibernate . tool . schema . internal . ExceptionHandlerLoggedImpl handleException
WARN : GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement
org . hibernate . tool . schema . spi . CommandAcceptanceException : Error executing DDL via JDBC Statement
at org . hibernate . tool . schema . internal . exec . GenerationTargetToDatabase . accept ( GenerationTargetToDatabase . java : 67 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . applySqlString ( SchemaCreatorImpl . java : 440 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . applySqlStrings ( SchemaCreatorImpl . java : 424 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . createFromMetadata ( SchemaCreatorImpl . java : 315 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . performCreation ( SchemaCreatorImpl . java : 166 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . doCreation ( SchemaCreatorImpl . java : 135 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . doCreation ( SchemaCreatorImpl . java : 121 )
at org . hibernate . tool . schema . spi . SchemaManagementToolCoordinator . performDatabaseAction ( SchemaManagementToolCoordinator . java : 155 )
at org . hibernate . tool . schema . spi . SchemaManagementToolCoordinator . process ( SchemaManagementToolCoordinator . java : 72 )
at org . hibernate . internal . SessionFactoryImpl . < init > ( SessionFactoryImpl . java : 309 )
at org . hibernate . boot . internal . SessionFactoryBuilderImpl . build ( SessionFactoryBuilderImpl . java : 452 )
at org . hibernate . jpa . boot . internal . EntityManagerFactoryBuilderImpl . build ( EntityManagerFactoryBuilderImpl . java : 889 )
at org . hibernate . jpa . HibernatePersistenceProvider . createEntityManagerFactory ( HibernatePersistenceProvider . java : 58 )
at javax . persistence . Persistence . createEntityManagerFactory ( Persistence . java : 55 )
at javax . persistence . Persistence . createEntityManagerFactory ( Persistence . java : 39 )
at PersistenceAutomovel . main ( PersistenceAutomovel . java : 11 )
Caused by : 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 ' type = InnoDB ' at line 1
at sun . reflect . NativeConstructorAccessorImpl . newInstance0 ( Native Method )
at sun . reflect . NativeConstructorAccessorImpl . newInstance ( Unknown Source )
at sun . reflect . DelegatingConstructorAccessorImpl . newInstance ( Unknown Source )
at java . lang . reflect . Constructor . newInstance ( Unknown Source )
at com . mysql . jdbc . Util . handleNewInstance ( Util . java : 425 )
at com . mysql . jdbc . Util . getInstance ( Util . java : 408 )
at com . mysql . jdbc . SQLError . createSQLException ( SQLError . java : 943 )
at com . mysql . jdbc . MysqlIO . checkErrorPacket ( MysqlIO . java : 3973 )
at com . mysql . jdbc . MysqlIO . checkErrorPacket ( MysqlIO . java : 3909 )
at com . mysql . jdbc . MysqlIO . sendCommand ( MysqlIO . java : 2527 )
at com . mysql . jdbc . MysqlIO . sqlQueryDirect ( MysqlIO . java : 2680 )
at com . mysql . jdbc . ConnectionImpl . execSQL ( ConnectionImpl . java : 2486 )
at com . mysql . jdbc . ConnectionImpl . execSQL ( ConnectionImpl . java : 2444 )
at com . mysql . jdbc . StatementImpl . executeInternal ( StatementImpl . java : 845 )
at com . mysql . jdbc . StatementImpl . execute ( StatementImpl . java : 745 )
at org . hibernate . tool . schema . internal . exec . GenerationTargetToDatabase . accept ( GenerationTargetToDatabase . java : 54 )
... 15 more
jun 13 , 2017 11 : 34 : 28 AM org . hibernate . tool . schema . internal . ExceptionHandlerLoggedImpl handleException
WARN : GenerationTarget encountered exception accepting command : Error executing DDL via JDBC Statement
org . hibernate . tool . schema . spi . CommandAcceptanceException : Error executing DDL via JDBC Statement
at org . hibernate . tool . schema . internal . exec . GenerationTargetToDatabase . accept ( GenerationTargetToDatabase . java : 67 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . applySqlString ( SchemaCreatorImpl . java : 440 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . applySqlStrings ( SchemaCreatorImpl . java : 424 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . createFromMetadata ( SchemaCreatorImpl . java : 315 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . performCreation ( SchemaCreatorImpl . java : 166 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . doCreation ( SchemaCreatorImpl . java : 135 )
at org . hibernate . tool . schema . internal . SchemaCreatorImpl . doCreation ( SchemaCreatorImpl . java : 121 )
at org . hibernate . tool . schema . spi . SchemaManagementToolCoordinator . performDatabaseAction ( SchemaManagementToolCoordinator . java : 155 )
at org . hibernate . tool . schema . spi . SchemaManagementToolCoordinator . process ( SchemaManagementToolCoordinator . java : 72 )
at org . hibernate . internal . SessionFactoryImpl . < init > ( SessionFactoryImpl . java : 309 )
at org . hibernate . boot . internal . SessionFactoryBuilderImpl . build ( SessionFactoryBuilderImpl . java : 452 )
at org . hibernate . jpa . boot . internal . EntityManagerFactoryBuilderImpl . build ( EntityManagerFactoryBuilderImpl . java : 889 )
at org . hibernate . jpa . HibernatePersistenceProvider . createEntityManagerFactory ( HibernatePersistenceProvider . java : 58 )
at javax . persistence . Persistence . createEntityManagerFactory ( Persistence . java : 55 )
at javax . persistence . Persistence . createEntityManagerFactory ( Persistence . java : 39 )
at PersistenceAutomovel . main ( PersistenceAutomovel . java : 11 )
Caused by : com . mysql . jdbc . exceptions . jdbc4 . MySQLSyntaxErrorException : Table ' teste . hibernate_sequence ' doesn ' t exist
at sun . reflect . NativeConstructorAccessorImpl . newInstance0 ( Native Method )
at sun . reflect . NativeConstructorAccessorImpl . newInstance ( Unknown Source )
at sun . reflect . DelegatingConstructorAccessorImpl . newInstance ( Unknown Source )
at java . lang . reflect . Constructor . newInstance ( Unknown Source )
at com . mysql . jdbc . Util . handleNewInstance ( Util . java : 425 )
at com . mysql . jdbc . Util . getInstance ( Util . java : 408 )
at com . mysql . jdbc . SQLError . createSQLException ( SQLError . java : 943 )
at com . mysql . jdbc . MysqlIO . checkErrorPacket ( MysqlIO . java : 3973 )
at com . mysql . jdbc . MysqlIO . checkErrorPacket ( MysqlIO . java : 3909 )
at com . mysql . jdbc . MysqlIO . sendCommand ( MysqlIO . java : 2527 )
at com . mysql . jdbc . MysqlIO . sqlQueryDirect ( MysqlIO . java : 2680 )
at com . mysql . jdbc . ConnectionImpl . execSQL ( ConnectionImpl . java : 2486 )
at com . mysql . jdbc . ConnectionImpl . execSQL ( ConnectionImpl . java : 2444 )
at com . mysql . jdbc . StatementImpl . executeInternal ( StatementImpl . java : 845 )
at com . mysql . jdbc . StatementImpl . execute ( StatementImpl . java : 745 )
at org . hibernate . tool . schema . internal . exec . GenerationTargetToDatabase . accept ( GenerationTargetToDatabase . java : 54 )
... 15 more
jun 13 , 2017 11 : 34 : 28 AM org . hibernate . tool . schema . internal . SchemaCreatorImpl applyImportSources
INFO : HHH000476 : Executing import script ' org . hibernate . tool . schema . internal . exec . ScriptSourceInputNonExistentImpl @2 a76840c '
Tue Jun 13 11 : 34 : 28 BRT 2017 WARN : Establishing SSL connection without server ' s identity verification is not recommended . According to MySQL 5.5.45 + , 5.6.26 + and 5.7.6 + requirements SSL connection must be established by default if explicit option isn ' t set . For compliance with existing applications not using SSL the verifyServerCertificate property is set to ' false ' . You need either to explicitly disable SSL by setting useSSL = false , or set useSSL = true and provide truststore for server certificate verification .
jun 13 , 2017 11 : 34 : 28 AM org . hibernate . id . enhanced . TableStructure$1$1 execute
ERROR : could not read a hi value
com . mysql . jdbc . exceptions . jdbc4 . MySQLSyntaxErrorException : Table ' teste . hibernate_sequence ' doesn ' t exist
at sun . reflect . NativeConstructorAccessorImpl . newInstance0 ( Native Method )
at sun . reflect . NativeConstructorAccessorImpl . newInstance ( Unknown Source )
at sun . reflect . DelegatingConstructorAccessorImpl . newInstance ( Unknown Source )
at java . lang . reflect . Constructor . newInstance ( Unknown Source )
at com . mysql . jdbc . Util . handleNewInstance ( Util . java : 425 )
at com . mysql . jdbc . Util . getInstance ( Util . java : 408 )
at com . mysql . jdbc . SQLError . createSQLException ( SQLError . java : 943 )
at com . mysql . jdbc . MysqlIO . checkErrorPacket ( MysqlIO . java : 3973 )
at com . mysql . jdbc . MysqlIO . checkErrorPacket ( MysqlIO . java : 3909 )
at com . mysql . jdbc . MysqlIO . sendCommand ( MysqlIO . java : 2527 )
at com . mysql . jdbc . MysqlIO . sqlQueryDirect ( MysqlIO . java : 2680 )
at com . mysql . jdbc . ConnectionImpl . execSQL ( ConnectionImpl . java : 2490 )
at com . mysql . jdbc . PreparedStatement . executeInternal ( PreparedStatement . java : 1858 )
at com . mysql . jdbc . PreparedStatement . executeQuery ( PreparedStatement . java : 1966 )
at org . hibernate . id . enhanced . TableStructure . executeQuery ( TableStructure . java : 216 )
at org . hibernate . id . enhanced . TableStructure . access$300 ( TableStructure . java : 46 )
at org . hibernate . id . enhanced . TableStructure$1$1 . execute ( TableStructure . java : 138 )
at org . hibernate . id . enhanced . TableStructure$1$1 . execute ( TableStructure . java : 126 )
at org . hibernate . jdbc . WorkExecutor . executeReturningWork ( WorkExecutor . java : 55 )
at org . hibernate . jdbc . AbstractReturningWork . accept ( AbstractReturningWork . java : 34 )
at org . hibernate . resource . transaction . backend . jdbc . internal . JdbcIsolationDelegate . delegateWork ( JdbcIsolationDelegate . java : 57 )
at org . hibernate . id . enhanced . TableStructure$1 . getNextValue ( TableStructure . java : 125 )
at org . hibernate . id . enhanced . NoopOptimizer . generate ( NoopOptimizer . java : 40 )
at org . hibernate . id . enhanced . SequenceStyleGenerator . generate ( SequenceStyleGenerator . java : 432 )
at org . hibernate . event . internal . AbstractSaveEventListener . saveWithGeneratedId ( AbstractSaveEventListener . java : 105 )
at org . hibernate . jpa . event . internal . core . JpaPersistEventListener . saveWithGeneratedId ( JpaPersistEventListener . java : 67 )
at org . hibernate . event . internal . DefaultPersistEventListener . entityIsTransient ( DefaultPersistEventListener . java : 189 )
at org . hibernate . event . internal . DefaultPersistEventListener . onPersist ( DefaultPersistEventListener . java : 132 )
at org . hibernate . event . internal . DefaultPersistEventListener . onPersist ( DefaultPersistEventListener . java : 58 )
at org . hibernate . internal . SessionImpl . firePersist ( SessionImpl . java : 780 )
at org . hibernate . internal . SessionImpl . persist ( SessionImpl . java : 765 )
at PersistenceAutomovel . main ( PersistenceAutomovel . java : 23 )
jun 13 , 2017 11 : 34 : 28 AM org . hibernate . engine . jdbc . spi . SqlExceptionHelper logExceptions
WARN : SQL Error : 1146 , SQLState : 42 S02
jun 13 , 2017 11 : 34 : 28 AM org . hibernate . engine . jdbc . spi . SqlExceptionHelper logExceptions
ERROR : Table ' teste . hibernate_sequence ' doesn ' t exist
Exception in thread "main" javax . persistence . PersistenceException : org . hibernate . exception . SQLGrammarException : error performing isolated work
at org . hibernate . internal . ExceptionConverterImpl . convert ( ExceptionConverterImpl . java : 147 )
at org . hibernate . internal . ExceptionConverterImpl . convert ( ExceptionConverterImpl . java : 155 )
at org . hibernate . internal . ExceptionConverterImpl . convert ( ExceptionConverterImpl . java : 162 )
at org . hibernate . internal . SessionImpl . firePersist ( SessionImpl . java : 787 )
at org . hibernate . internal . SessionImpl . persist ( SessionImpl . java : 765 )
at PersistenceAutomovel . main ( PersistenceAutomovel . java : 23 )
Caused by : org . hibernate . exception . SQLGrammarException : error performing isolated work
at org . hibernate . exception . internal . SQLExceptionTypeDelegate . convert ( SQLExceptionTypeDelegate . java : 63 )
at org . hibernate . exception . internal . StandardSQLExceptionConverter . convert ( StandardSQLExceptionConverter . java : 42 )
at org . hibernate . engine . jdbc . spi . SqlExceptionHelper . convert ( SqlExceptionHelper . java : 111 )
at org . hibernate . engine . jdbc . spi . SqlExceptionHelper . convert ( SqlExceptionHelper . java : 97 )
at org . hibernate . resource . transaction . backend . jdbc . internal . JdbcIsolationDelegate . delegateWork ( JdbcIsolationDelegate . java : 79 )
at org . hibernate . id . enhanced . TableStructure$1 . getNextValue ( TableStructure . java : 125 )
at org . hibernate . id . enhanced . NoopOptimizer . generate ( NoopOptimizer . java : 40 )
at org . hibernate . id . enhanced . SequenceStyleGenerator . generate ( SequenceStyleGenerator . java : 432 )
at org . hibernate . event . internal . AbstractSaveEventListener . saveWithGeneratedId ( AbstractSaveEventListener . java : 105 )
at org . hibernate . jpa . event . internal . core . JpaPersistEventListener . saveWithGeneratedId ( JpaPersistEventListener . java : 67 )
at org . hibernate . event . internal . DefaultPersistEventListener . entityIsTransient ( DefaultPersistEventListener . java : 189 )
at org . hibernate . event . internal . DefaultPersistEventListener . onPersist ( DefaultPersistEventListener . java : 132 )
at org . hibernate . event . internal . DefaultPersistEventListener . onPersist ( DefaultPersistEventListener . java : 58 )
at org . hibernate . internal . SessionImpl . firePersist ( SessionImpl . java : 780 )
... 2 more
Caused by : com . mysql . jdbc . exceptions . jdbc4 . MySQLSyntaxErrorException : Table ' teste . hibernate_sequence ' doesn ' t exist
at sun . reflect . NativeConstructorAccessorImpl . newInstance0 ( Native Method )
at sun . reflect . NativeConstructorAccessorImpl . newInstance ( Unknown Source )
at sun . reflect . DelegatingConstructorAccessorImpl . newInstance ( Unknown Source )
at java . lang . reflect . Constructor . newInstance ( Unknown Source )
at com . mysql . jdbc . Util . handleNewInstance ( Util . java : 425 )
at com . mysql . jdbc . Util . getInstance ( Util . java : 408 )
at com . mysql . jdbc . SQLError . createSQLException ( SQLError . java : 943 )
at com . mysql . jdbc . MysqlIO . checkErrorPacket ( MysqlIO . java : 3973 )
at com . mysql . jdbc . MysqlIO . checkErrorPacket ( MysqlIO . java : 3909 )
at com . mysql . jdbc . MysqlIO . sendCommand ( MysqlIO . java : 2527 )
at com . mysql . jdbc . MysqlIO . sqlQueryDirect ( MysqlIO . java : 2680 )
at com . mysql . jdbc . ConnectionImpl . execSQL ( ConnectionImpl . java : 2490 )
at com . mysql . jdbc . PreparedStatement . executeInternal ( PreparedStatement . java : 1858 )
at com . mysql . jdbc . PreparedStatement . executeQuery ( PreparedStatement . java : 1966 )
at org . hibernate . id . enhanced . TableStructure . executeQuery ( TableStructure . java : 216 )
at org . hibernate . id . enhanced . TableStructure . access$300 ( TableStructure . java : 46 )
at org . hibernate . id . enhanced . TableStructure$1$1 . execute ( TableStructure . java : 138 )
at org . hibernate . id . enhanced . TableStructure$1$1 . execute ( TableStructure . java : 126 )
at org . hibernate . jdbc . WorkExecutor . executeReturningWork ( WorkExecutor . java : 55 )
at org . hibernate . jdbc . AbstractReturningWork . accept ( AbstractReturningWork . java : 34 )
at org . hibernate . resource . transaction . backend . jdbc . internal . JdbcIsolationDelegate . delegateWork ( JdbcIsolationDelegate . java : 57 )
... 11 more
Pedro_Henrique4 27 de jul. de 2017
Cara, aprece que você não criou shema teste no Mysql
Pedro_Henrique4 27 de jul. de 2017
< property name = "hibernate.default_schema" value = "teste" />
raphaeloneves 27 de jul. de 2017
Eis a causa do seu problema! Veja se o schema teste está criado no banco de dados.