SpringBoot2版本Caused by: java.sql.SQLSyntaxErrorException: Table 'dinner.hibernate_sequenc

1、SpringBoot2版本Caused by: java.sql.SQLSyntaxErrorException: Table 'dinner.hibernate_sequenc报错。

  1 "C:\Program Files\Java\jdk1.8.0_161\bin\java.exe" -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:D:\biehl\idea\lib\idea_rt.jar=53250:D:\biehl\idea\bin -Dfile.encoding=UTF-8 -classpath "D:\biehl\idea\lib\idea_rt.jar;D:\biehl\idea\plugins\junit\lib\junit-rt.jar;D:\biehl\idea\plugins\junit\lib\junit5-rt.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_161\jre\lib\rt.jar;D:\biehl\idea\workspace\dinner\target\test-classes;D:\biehl\idea\workspace\dinner\target\classes;D:\maven\apache-maven-3.5.4\repository\org\springframework\boot\spring-boot-starter-web\2.1.6.RELEASE\spring-boot-starter-web-2.1.6.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\boot\spring-boot-starter\2.1.6.RELEASE\spring-boot-starter-2.1.6.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\boot\spring-boot\2.1.6.RELEASE\spring-boot-2.1.6.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\boot\spring-boot-autoconfigure\2.1.6.RELEASE\spring-boot-autoconfigure-2.1.6.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\boot\spring-boot-starter-logging\2.1.6.RELEASE\spring-boot-starter-logging-2.1.6.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;D:\maven\apache-maven-3.5.4\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;D:\maven\apache-maven-3.5.4\repository\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;D:\maven\apache-maven-3.5.4\repository\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;D:\maven\apache-maven-3.5.4\repository\org\slf4j\jul-to-slf4j\1.7.26\jul-to-slf4j-1.7.26.jar;D:\maven\apache-maven-3.5.4\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;D:\maven\apache-maven-3.5.4\repository\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\boot\spring-boot-starter-json\2.1.6.RELEASE\spring-boot-starter-json-2.1.6.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\com\fasterxml\jackson\core\jackson-databind\2.9.9\jackson-databind-2.9.9.jar;D:\maven\apache-maven-3.5.4\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;D:\maven\apache-maven-3.5.4\repository\com\fasterxml\jackson\core\jackson-core\2.9.9\jackson-core-2.9.9.jar;D:\maven\apache-maven-3.5.4\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.9\jackson-datatype-jdk8-2.9.9.jar;D:\maven\apache-maven-3.5.4\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.9\jackson-datatype-jsr310-2.9.9.jar;D:\maven\apache-maven-3.5.4\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.9\jackson-module-parameter-names-2.9.9.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\boot\spring-boot-starter-tomcat\2.1.6.RELEASE\spring-boot-starter-tomcat-2.1.6.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.21\tomcat-embed-core-9.0.21.jar;D:\maven\apache-maven-3.5.4\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.21\tomcat-embed-el-9.0.21.jar;D:\maven\apache-maven-3.5.4\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.21\tomcat-embed-websocket-9.0.21.jar;D:\maven\apache-maven-3.5.4\repository\org\hibernate\validator\hibernate-validator\6.0.17.Final\hibernate-validator-6.0.17.Final.jar;D:\maven\apache-maven-3.5.4\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;D:\maven\apache-maven-3.5.4\repository\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;D:\maven\apache-maven-3.5.4\repository\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\spring-web\5.1.8.RELEASE\spring-web-5.1.8.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\spring-beans\5.1.8.RELEASE\spring-beans-5.1.8.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\spring-webmvc\5.1.8.RELEASE\spring-webmvc-5.1.8.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\spring-aop\5.1.8.RELEASE\spring-aop-5.1.8.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\spring-context\5.1.8.RELEASE\spring-context-5.1.8.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\spring-expression\5.1.8.RELEASE\spring-expression-5.1.8.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\boot\spring-boot-starter-test\2.1.6.RELEASE\spring-boot-starter-test-2.1.6.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\boot\spring-boot-test\2.1.6.RELEASE\spring-boot-test-2.1.6.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\boot\spring-boot-test-autoconfigure\2.1.6.RELEASE\spring-boot-test-autoconfigure-2.1.6.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\com\jayway\jsonpath\json-path\2.4.0\json-path-2.4.0.jar;D:\maven\apache-maven-3.5.4\repository\net\minidev\json-smart\2.3\json-smart-2.3.jar;D:\maven\apache-maven-3.5.4\repository\net\minidev\accessors-smart\1.2\accessors-smart-1.2.jar;D:\maven\apache-maven-3.5.4\repository\org\ow2\asm\asm\5.0.4\asm-5.0.4.jar;D:\maven\apache-maven-3.5.4\repository\org\slf4j\slf4j-api\1.7.26\slf4j-api-1.7.26.jar;D:\maven\apache-maven-3.5.4\repository\junit\junit\4.12\junit-4.12.jar;D:\maven\apache-maven-3.5.4\repository\org\assertj\assertj-core\3.11.1\assertj-core-3.11.1.jar;D:\maven\apache-maven-3.5.4\repository\org\mockito\mockito-core\2.23.4\mockito-core-2.23.4.jar;D:\maven\apache-maven-3.5.4\repository\net\bytebuddy\byte-buddy\1.9.13\byte-buddy-1.9.13.jar;D:\maven\apache-maven-3.5.4\repository\net\bytebuddy\byte-buddy-agent\1.9.13\byte-buddy-agent-1.9.13.jar;D:\maven\apache-maven-3.5.4\repository\org\objenesis\objenesis\2.6\objenesis-2.6.jar;D:\maven\apache-maven-3.5.4\repository\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;D:\maven\apache-maven-3.5.4\repository\org\hamcrest\hamcrest-library\1.3\hamcrest-library-1.3.jar;D:\maven\apache-maven-3.5.4\repository\org\skyscreamer\jsonassert\1.5.0\jsonassert-1.5.0.jar;D:\maven\apache-maven-3.5.4\repository\com\vaadin\external\google\android-json\0.0.20131108.vaadin1\android-json-0.0.20131108.vaadin1.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\spring-core\5.1.8.RELEASE\spring-core-5.1.8.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\spring-jcl\5.1.8.RELEASE\spring-jcl-5.1.8.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\spring-test\5.1.8.RELEASE\spring-test-5.1.8.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\xmlunit\xmlunit-core\2.6.2\xmlunit-core-2.6.2.jar;D:\maven\apache-maven-3.5.4\repository\org\projectlombok\lombok\1.18.8\lombok-1.18.8.jar;D:\maven\apache-maven-3.5.4\repository\mysql\mysql-connector-java\8.0.16\mysql-connector-java-8.0.16.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\boot\spring-boot-starter-data-jpa\2.1.6.RELEASE\spring-boot-starter-data-jpa-2.1.6.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\boot\spring-boot-starter-aop\2.1.6.RELEASE\spring-boot-starter-aop-2.1.6.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\aspectj\aspectjweaver\1.9.4\aspectjweaver-1.9.4.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\boot\spring-boot-starter-jdbc\2.1.6.RELEASE\spring-boot-starter-jdbc-2.1.6.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\com\zaxxer\HikariCP\3.2.0\HikariCP-3.2.0.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\spring-jdbc\5.1.8.RELEASE\spring-jdbc-5.1.8.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\javax\transaction\javax.transaction-api\1.3\javax.transaction-api-1.3.jar;D:\maven\apache-maven-3.5.4\repository\javax\xml\bind\jaxb-api\2.3.1\jaxb-api-2.3.1.jar;D:\maven\apache-maven-3.5.4\repository\javax\activation\javax.activation-api\1.2.0\javax.activation-api-1.2.0.jar;D:\maven\apache-maven-3.5.4\repository\org\hibernate\hibernate-core\5.3.10.Final\hibernate-core-5.3.10.Final.jar;D:\maven\apache-maven-3.5.4\repository\javax\persistence\javax.persistence-api\2.2\javax.persistence-api-2.2.jar;D:\maven\apache-maven-3.5.4\repository\org\javassist\javassist\3.23.2-GA\javassist-3.23.2-GA.jar;D:\maven\apache-maven-3.5.4\repository\antlr\antlr\2.7.7\antlr-2.7.7.jar;D:\maven\apache-maven-3.5.4\repository\org\jboss\jandex\2.0.5.Final\jandex-2.0.5.Final.jar;D:\maven\apache-maven-3.5.4\repository\org\dom4j\dom4j\2.1.1\dom4j-2.1.1.jar;D:\maven\apache-maven-3.5.4\repository\org\hibernate\common\hibernate-commons-annotations\5.0.4.Final\hibernate-commons-annotations-5.0.4.Final.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\data\spring-data-jpa\2.1.9.RELEASE\spring-data-jpa-2.1.9.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\data\spring-data-commons\2.1.9.RELEASE\spring-data-commons-2.1.9.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\spring-orm\5.1.8.RELEASE\spring-orm-5.1.8.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\spring-tx\5.1.8.RELEASE\spring-tx-5.1.8.RELEASE.jar;D:\maven\apache-maven-3.5.4\repository\org\springframework\spring-aspects\5.1.8.RELEASE\spring-aspects-5.1.8.RELEASE.jar" com.intellij.rt.execution.junit.JUnitStarter -ideVersion5 -junit4 com.bie.dinner.dao.ProductCategoryDaoTest,addOneProductCategory
  2 19:36:07.089 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class com.bie.dinner.dao.ProductCategoryDaoTest]
  3 19:36:07.102 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]
  4 19:36:07.122 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]
  5 19:36:07.206 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [com.bie.dinner.dao.ProductCategoryDaoTest] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper]
  6 19:36:07.263 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [com.bie.dinner.dao.ProductCategoryDaoTest], using SpringBootContextLoader
  7 19:36:07.273 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.bie.dinner.dao.ProductCategoryDaoTest]: class path resource [com/bie/dinner/dao/ProductCategoryDaoTest-context.xml] does not exist
  8 19:36:07.273 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [com.bie.dinner.dao.ProductCategoryDaoTest]: class path resource [com/bie/dinner/dao/ProductCategoryDaoTestContext.groovy] does not exist
  9 19:36:07.274 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [com.bie.dinner.dao.ProductCategoryDaoTest]: no resource found for suffixes {-context.xml, Context.groovy}.
 10 19:36:07.276 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [com.bie.dinner.dao.ProductCategoryDaoTest]: ProductCategoryDaoTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.
 11 19:36:07.437 [main] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [com.bie.dinner.dao.ProductCategoryDaoTest]
 12 19:36:07.786 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [D:\biehl\idea\workspace\dinner\target\classes\com\bie\dinner\DinnerApplication.class]
 13 19:36:07.788 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration com.bie.dinner.DinnerApplication for test class com.bie.dinner.dao.ProductCategoryDaoTest
 14 19:36:08.220 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [com.bie.dinner.dao.ProductCategoryDaoTest]: using defaults.
 15 19:36:08.221 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener]
 16 19:36:08.341 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@43195e57, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@333291e3, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@479d31f3, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@40ef3420, org.springframework.test.context.support.DirtiesContextTestExecutionListener@498d318c, org.springframework.test.context.transaction.TransactionalTestExecutionListener@6e171cd7, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@402bba4f, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@795cd85e, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@59fd97a8, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@f5ac9e4, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@123ef382, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@dbf57b3]
 17 19:36:08.353 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.bie.dinner.dao.ProductCategoryDaoTest]
 18 19:36:08.354 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.bie.dinner.dao.ProductCategoryDaoTest]19:36:08.405 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.bie.dinner.dao.ProductCategoryDaoTest]
 19 19:36:08.405 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.bie.dinner.dao.ProductCategoryDaoTest]19:36:08.407 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.bie.dinner.dao.ProductCategoryDaoTest]
 20 19:36:08.408 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.bie.dinner.dao.ProductCategoryDaoTest]
 21 19:36:08.409 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.bie.dinner.dao.ProductCategoryDaoTest]
 22 19:36:08.409 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.bie.dinner.dao.ProductCategoryDaoTest]
 23 19:36:08.421 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - Before test class: context [DefaultTestContext@6b81ce95 testClass = ProductCategoryDaoTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@2a798d51 testClass = ProductCategoryDaoTest, locations = '{}', classes = '{class com.bie.dinner.DinnerApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@27a5f880, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@167fdd33, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@34cd072c, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@7e2d773b], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true]], class annotated with @DirtiesContext [false] with mode [null].
 24 19:36:08.422 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [com.bie.dinner.dao.ProductCategoryDaoTest]
 25 19:36:08.422 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [com.bie.dinner.dao.ProductCategoryDaoTest]
 26 19:36:08.556 [main] DEBUG org.springframework.test.context.support.TestPropertySourceUtils - Adding inlined properties to environment: {spring.jmx.enabled=false, org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true, server.port=-1}
 27 
 28   .   ____          _            __ _ _
 29  /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
 30 ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 31  \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
 32   '  |____| .__|_| |_|_| |_\__, | / / / /
 33  =========|_|==============|___/=/_/_/_/
 34  :: Spring Boot ::        (v2.1.6.RELEASE)
 35 
 36 19:36:09.660 default [main] INFO  c.b.d.dao.ProductCategoryDaoTest Starting ProductCategoryDaoTest on DESKTOP-T450s with PID 8956 (started by Aiyufei in D:\biehl\idea\workspace\dinner)
 37 19:36:09.662 default [main] INFO  c.b.d.dao.ProductCategoryDaoTest No active profile set, falling back to default profiles: default
 38 19:36:12.213 default [main] INFO  o.s.d.r.c.RepositoryConfigurationDelegate Bootstrapping Spring Data repositories in DEFAULT mode.
 39 19:36:12.383 default [main] INFO  o.s.d.r.c.RepositoryConfigurationDelegate Finished Spring Data repository scanning in 153ms. Found 1 repository interfaces.
 40 19:36:13.529 default [main] INFO  o.s.c.s.PostProcessorRegistrationDelegate$BeanPostProcessorChecker Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$4491119] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
 41 Loading class `com.mysql.jdbc.Driver'. This is deprecated. The new driver class is `com.mysql.cj.jdbc.Driver'. The driver is automatically registered via the SPI and manual loading of the driver class is generally unnecessary.
 42 19:36:14.282 default [main] INFO  com.zaxxer.hikari.HikariDataSource HikariPool-1 - Starting...
 43 19:36:14.291 default [main] WARN  c.z.hikari.util.DriverDataSource Registered driver with driverClassName=com.mysql.jdbc.Driver was not found, trying direct instantiation.
 44 19:36:14.897 default [main] INFO  com.zaxxer.hikari.HikariDataSource HikariPool-1 - Start completed.
 45 19:36:15.163 default [main] INFO  o.h.jpa.internal.util.LogHelper HHH000204: Processing PersistenceUnitInfo [
 46     name: default
 47     ...]
 48 19:36:15.380 default [main] INFO  org.hibernate.Version HHH000412: Hibernate Core {5.3.10.Final}
 49 19:36:15.383 default [main] INFO  org.hibernate.cfg.Environment HHH000206: hibernate.properties not found
 50 19:36:15.738 default [main] INFO  o.h.annotations.common.Version HCANN000001: Hibernate Commons Annotations {5.0.4.Final}
 51 19:36:16.598 default [main] INFO  org.hibernate.dialect.Dialect HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
 52 19:36:17.907 default [main] INFO  o.s.o.j.LocalContainerEntityManagerFactoryBean Initialized JPA EntityManagerFactory for persistence unit 'default'
 53 19:36:20.031 default [main] INFO  o.s.s.c.ThreadPoolTaskExecutor Initializing ExecutorService 'applicationTaskExecutor'
 54 19:36:20.193 default [main] WARN  o.s.b.a.o.j.JpaBaseConfiguration$JpaWebConfiguration$JpaWebMvcConfiguration spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
 55 19:36:21.927 default [main] INFO  c.b.d.dao.ProductCategoryDaoTest Started ProductCategoryDaoTest in 13.342 seconds (JVM running for 16.487)
 56 Hibernate: select next_val as id_val from hibernate_sequence for update
 57 19:36:22.475 default [main] ERROR o.h.id.enhanced.TableStructure could not read a hi value
 58 java.sql.SQLSyntaxErrorException: Table 'dinner.hibernate_sequence' doesn't exist
 59     at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
 60     at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
 61     at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
 62     at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:955)
 63     at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1005)
 64     at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
 65     at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
 66     at org.hibernate.id.enhanced.TableStructure.executeQuery(TableStructure.java:216)
 67     at org.hibernate.id.enhanced.TableStructure.access$300(TableStructure.java:46)
 68     at org.hibernate.id.enhanced.TableStructure$1$1.execute(TableStructure.java:138)
 69     at org.hibernate.id.enhanced.TableStructure$1$1.execute(TableStructure.java:126)
 70     at org.hibernate.jdbc.WorkExecutor.executeReturningWork(WorkExecutor.java:55)
 71     at org.hibernate.jdbc.AbstractReturningWork.accept(AbstractReturningWork.java:34)
 72     at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.delegateWork(JdbcIsolationDelegate.java:57)
 73     at org.hibernate.id.enhanced.TableStructure$1.getNextValue(TableStructure.java:125)
 74     at org.hibernate.id.enhanced.NoopOptimizer.generate(NoopOptimizer.java:40)
 75     at org.hibernate.id.enhanced.SequenceStyleGenerator.generate(SequenceStyleGenerator.java:482)
 76     at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:119)
 77     at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:192)
 78     at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135)
 79     at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:62)
 80     at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:800)
 81     at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:785)
 82     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 83     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 84     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 85     at java.lang.reflect.Method.invoke(Method.java:498)
 86     at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:308)
 87     at com.sun.proxy.$Proxy88.persist(Unknown Source)
 88     at org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:507)
 89     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 90     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 91     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 92     at java.lang.reflect.Method.invoke(Method.java:498)
 93     at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:359)
 94     at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:200)
 95     at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:644)
 96     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
 97     at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:608)
 98     at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$invoke$3(RepositoryFactorySupport.java:595)
 99     at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:595)
100     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
101     at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
102     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
103     at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
104     at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
105     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
106     at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
107     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
108     at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:138)
109     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
110     at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
111     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
112     at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61)
113     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
114     at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
115     at com.sun.proxy.$Proxy90.save(Unknown Source)
116     at com.bie.dinner.dao.ProductCategoryDaoTest.addOneProductCategory(ProductCategoryDaoTest.java:46)
117     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
118     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
119     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
120     at java.lang.reflect.Method.invoke(Method.java:498)
121     at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
122     at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
123     at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
124     at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
125     at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74)
126     at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)
127     at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
128     at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
129     at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
130     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
131     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
132     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
133     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
134     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
135     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
136     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
137     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
138     at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
139     at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
140     at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
141     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
142     at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
143     at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
144     at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
145     at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
146     at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
147 19:36:22.498 default [main] WARN  o.h.e.jdbc.spi.SqlExceptionHelper SQL Error: 1146, SQLState: 42S02
148 19:36:22.500 default [main] ERROR o.h.e.jdbc.spi.SqlExceptionHelper Table 'dinner.hibernate_sequence' doesn't exist
149 
150 org.springframework.dao.InvalidDataAccessResourceUsageException: error performing isolated work; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: error performing isolated work
151 
152     at org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:279)
153     at org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:253)
154     at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:527)
155     at org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61)
156     at org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:242)
157     at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:153)
158     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
159     at org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:138)
160     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
161     at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)
162     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
163     at org.springframework.data.repository.core.support.SurroundingTransactionDetectorMethodInterceptor.invoke(SurroundingTransactionDetectorMethodInterceptor.java:61)
164     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
165     at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
166     at com.sun.proxy.$Proxy90.save(Unknown Source)
167     at com.bie.dinner.dao.ProductCategoryDaoTest.addOneProductCategory(ProductCategoryDaoTest.java:46)
168     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
169     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
170     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
171     at java.lang.reflect.Method.invoke(Method.java:498)
172     at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
173     at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
174     at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
175     at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
176     at org.springframework.test.context.junit4.statements.RunBeforeTestExecutionCallbacks.evaluate(RunBeforeTestExecutionCallbacks.java:74)
177     at org.springframework.test.context.junit4.statements.RunAfterTestExecutionCallbacks.evaluate(RunAfterTestExecutionCallbacks.java:84)
178     at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:75)
179     at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:86)
180     at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:84)
181     at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
182     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:251)
183     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:97)
184     at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
185     at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
186     at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
187     at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
188     at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
189     at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
190     at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:70)
191     at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
192     at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:190)
193     at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
194     at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:68)
195     at com.intellij.rt.execution.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:47)
196     at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:242)
197     at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:70)
198 Caused by: org.hibernate.exception.SQLGrammarException: error performing isolated work
199     at org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:63)
200     at org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:42)
201     at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:113)
202     at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:99)
203     at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.delegateWork(JdbcIsolationDelegate.java:79)
204     at org.hibernate.id.enhanced.TableStructure$1.getNextValue(TableStructure.java:125)
205     at org.hibernate.id.enhanced.NoopOptimizer.generate(NoopOptimizer.java:40)
206     at org.hibernate.id.enhanced.SequenceStyleGenerator.generate(SequenceStyleGenerator.java:482)
207     at org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:119)
208     at org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:192)
209     at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:135)
210     at org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:62)
211     at org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:800)
212     at org.hibernate.internal.SessionImpl.persist(SessionImpl.java:785)
213     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
214     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
215     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
216     at java.lang.reflect.Method.invoke(Method.java:498)
217     at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:308)
218     at com.sun.proxy.$Proxy88.persist(Unknown Source)
219     at org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:507)
220     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
221     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
222     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
223     at java.lang.reflect.Method.invoke(Method.java:498)
224     at org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:359)
225     at org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:200)
226     at org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:644)
227     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
228     at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:608)
229     at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.lambda$invoke$3(RepositoryFactorySupport.java:595)
230     at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:595)
231     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
232     at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:59)
233     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
234     at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:295)
235     at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:98)
236     at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
237     at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)
238     ... 40 more
239 Caused by: java.sql.SQLSyntaxErrorException: Table 'dinner.hibernate_sequence' doesn't exist
240     at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:120)
241     at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
242     at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
243     at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:955)
244     at com.mysql.cj.jdbc.ClientPreparedStatement.executeQuery(ClientPreparedStatement.java:1005)
245     at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeQuery(ProxyPreparedStatement.java:52)
246     at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeQuery(HikariProxyPreparedStatement.java)
247     at org.hibernate.id.enhanced.TableStructure.executeQuery(TableStructure.java:216)
248     at org.hibernate.id.enhanced.TableStructure.access$300(TableStructure.java:46)
249     at org.hibernate.id.enhanced.TableStructure$1$1.execute(TableStructure.java:138)
250     at org.hibernate.id.enhanced.TableStructure$1$1.execute(TableStructure.java:126)
251     at org.hibernate.jdbc.WorkExecutor.executeReturningWork(WorkExecutor.java:55)
252     at org.hibernate.jdbc.AbstractReturningWork.accept(AbstractReturningWork.java:34)
253     at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcIsolationDelegate.delegateWork(JdbcIsolationDelegate.java:57)
254     ... 74 more
255 
256 19:36:22.764 default [Thread-2] INFO  o.s.s.c.ThreadPoolTaskExecutor Shutting down ExecutorService 'applicationTaskExecutor'
257 19:36:22.769 default [Thread-2] INFO  o.s.o.j.LocalContainerEntityManagerFactoryBean Closing JPA EntityManagerFactory for persistence unit 'default'
258 19:36:22.807 default [Thread-2] INFO  com.zaxxer.hikari.HikariDataSource HikariPool-1 - Shutdown initiated...
259 19:36:22.890 default [Thread-2] INFO  com.zaxxer.hikari.HikariDataSource HikariPool-1 - Shutdown completed.
260 
261 Process finished with exit code -1

解决方法:

@Id  //主键
@GeneratedValue(strategy = GenerationType.IDENTITY)   //自增设置,之前没有设置自增,报了错误
private Integer categoryId;//类目编号
 1 public enum GenerationType { 
 2 
 3     /**
 4      * Indicates that the persistence provider must assign 
 5      * primary keys for the entity using an underlying 
 6      * database table to ensure uniqueness.
 7      */
 8     TABLE, 
 9 
10     /**
11      * Indicates that the persistence provider must assign 
12      * primary keys for the entity using a database sequence.
13      */
14     SEQUENCE, 
15 
16     /**
17      * Indicates that the persistence provider must assign 
18      * primary keys for the entity using a database identity column.
19      */
20     IDENTITY, 
21 
22     /**
23      * Indicates that the persistence provider should pick an 
24      * appropriate strategy for the particular database. The 
25      * AUTO generation strategy may expect a database 
26      * resource to exist, or it may attempt to create one. A vendor 
27      * may provide documentation on how to create such resources 
28      * in the event that it does not support schema generation 
29      * or cannot create the schema resource at runtime.
30      */
31     AUTO
32 }

SpringBoot的@GeneratedValue 是不需要加参数的,但是如果数据库控制主键自增(auto_increment), 不加参数就会报错。

@GeneratedValue注解的strategy属性提供四种值:

1 -AUTO主键由程序控制, 是默认选项 ,不设置就是这个。
2 
3 -IDENTITY 主键由数据库生成, 采用数据库自增长, Oracle不支持这种方式。mysql数据库设置这个。可以将自增的主键回显回来。
4 
5 -SEQUENCE 通过数据库的序列产生主键, MYSQL  不支持。Oracle数据库设置这个。
6 
7 -Table 提供特定的数据库产生主键, 该方式更有利于数据库的移植。

待续.......

你可能感兴趣的:(SpringBoot2版本Caused by: java.sql.SQLSyntaxErrorException: Table 'dinner.hibernate_sequenc)