1、SpringBoot2版本Caused by: java.sql.SQLSyntaxErrorException: Table 'dinner.hibernate_sequenc报错。
1 "C:Program FilesJavajdk1.8.0_161injava.exe" -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:D:iehlidealibidea_rt.jar=53250:D:iehlideain -Dfile.encoding=UTF-8 -classpath "D:iehlidealibidea_rt.jar;D:iehlideapluginsjunitlibjunit-rt.jar;D:iehlideapluginsjunitlibjunit5-rt.jar;C:Program FilesJavajdk1.8.0_161jrelibcharsets.jar;C:Program FilesJavajdk1.8.0_161jrelibdeploy.jar;C:Program FilesJavajdk1.8.0_161jrelibextaccess-bridge-64.jar;C:Program FilesJavajdk1.8.0_161jrelibextcldrdata.jar;C:Program FilesJavajdk1.8.0_161jrelibextdnsns.jar;C:Program FilesJavajdk1.8.0_161jrelibextjaccess.jar;C:Program FilesJavajdk1.8.0_161jrelibextjfxrt.jar;C:Program FilesJavajdk1.8.0_161jrelibextlocaledata.jar;C:Program FilesJavajdk1.8.0_161jrelibext ashorn.jar;C:Program FilesJavajdk1.8.0_161jrelibextsunec.jar;C:Program FilesJavajdk1.8.0_161jrelibextsunjce_provider.jar;C:Program FilesJavajdk1.8.0_161jrelibextsunmscapi.jar;C:Program FilesJavajdk1.8.0_161jrelibextsunpkcs11.jar;C:Program FilesJavajdk1.8.0_161jrelibextzipfs.jar;C:Program FilesJavajdk1.8.0_161jrelibjavaws.jar;C:Program FilesJavajdk1.8.0_161jrelibjce.jar;C:Program FilesJavajdk1.8.0_161jrelibjfr.jar;C:Program FilesJavajdk1.8.0_161jrelibjfxswt.jar;C:Program FilesJavajdk1.8.0_161jrelibjsse.jar;C:Program FilesJavajdk1.8.0_161jrelibmanagement-agent.jar;C:Program FilesJavajdk1.8.0_161jrelibplugin.jar;C:Program FilesJavajdk1.8.0_161jrelib esources.jar;C:Program FilesJavajdk1.8.0_161jrelib t.jar;D:iehlideaworkspacedinner arget est-classes;D:iehlideaworkspacedinner argetclasses;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkootspring-boot-starter-web2.1.6.RELEASEspring-boot-starter-web-2.1.6.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkootspring-boot-starter2.1.6.RELEASEspring-boot-starter-2.1.6.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkootspring-boot2.1.6.RELEASEspring-boot-2.1.6.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkootspring-boot-autoconfigure2.1.6.RELEASEspring-boot-autoconfigure-2.1.6.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkootspring-boot-starter-logging2.1.6.RELEASEspring-boot-starter-logging-2.1.6.RELEASE.jar;D:mavenapache-maven-3.5.4 epositorychqoslogbacklogback-classic1.2.3logback-classic-1.2.3.jar;D:mavenapache-maven-3.5.4 epositorychqoslogbacklogback-core1.2.3logback-core-1.2.3.jar;D:mavenapache-maven-3.5.4 epositoryorgapachelogginglog4jlog4j-to-slf4j2.11.2log4j-to-slf4j-2.11.2.jar;D:mavenapache-maven-3.5.4 epositoryorgapachelogginglog4jlog4j-api2.11.2log4j-api-2.11.2.jar;D:mavenapache-maven-3.5.4 epositoryorgslf4jjul-to-slf4j1.7.26jul-to-slf4j-1.7.26.jar;D:mavenapache-maven-3.5.4 epositoryjavaxannotationjavax.annotation-api1.3.2javax.annotation-api-1.3.2.jar;D:mavenapache-maven-3.5.4 epositoryorgyamlsnakeyaml1.23snakeyaml-1.23.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkootspring-boot-starter-json2.1.6.RELEASEspring-boot-starter-json-2.1.6.RELEASE.jar;D:mavenapache-maven-3.5.4 epositorycomfasterxmljacksoncorejackson-databind2.9.9jackson-databind-2.9.9.jar;D:mavenapache-maven-3.5.4 epositorycomfasterxmljacksoncorejackson-annotations2.9.0jackson-annotations-2.9.0.jar;D:mavenapache-maven-3.5.4 epositorycomfasterxmljacksoncorejackson-core2.9.9jackson-core-2.9.9.jar;D:mavenapache-maven-3.5.4 epositorycomfasterxmljacksondatatypejackson-datatype-jdk82.9.9jackson-datatype-jdk8-2.9.9.jar;D:mavenapache-maven-3.5.4 epositorycomfasterxmljacksondatatypejackson-datatype-jsr3102.9.9jackson-datatype-jsr310-2.9.9.jar;D:mavenapache-maven-3.5.4 epositorycomfasterxmljacksonmodulejackson-module-parameter-names2.9.9jackson-module-parameter-names-2.9.9.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkootspring-boot-starter-tomcat2.1.6.RELEASEspring-boot-starter-tomcat-2.1.6.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgapache omcatembed omcat-embed-core9.0.21 omcat-embed-core-9.0.21.jar;D:mavenapache-maven-3.5.4 epositoryorgapache omcatembed omcat-embed-el9.0.21 omcat-embed-el-9.0.21.jar;D:mavenapache-maven-3.5.4 epositoryorgapache omcatembed omcat-embed-websocket9.0.21 omcat-embed-websocket-9.0.21.jar;D:mavenapache-maven-3.5.4 epositoryorghibernatevalidatorhibernate-validator6.0.17.Finalhibernate-validator-6.0.17.Final.jar;D:mavenapache-maven-3.5.4 epositoryjavaxvalidationvalidation-api2.0.1.Finalvalidation-api-2.0.1.Final.jar;D:mavenapache-maven-3.5.4 epositoryorgjbossloggingjboss-logging3.3.2.Finaljboss-logging-3.3.2.Final.jar;D:mavenapache-maven-3.5.4 epositorycomfasterxmlclassmate1.4.0classmate-1.4.0.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkspring-web5.1.8.RELEASEspring-web-5.1.8.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkspring-beans5.1.8.RELEASEspring-beans-5.1.8.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkspring-webmvc5.1.8.RELEASEspring-webmvc-5.1.8.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkspring-aop5.1.8.RELEASEspring-aop-5.1.8.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkspring-context5.1.8.RELEASEspring-context-5.1.8.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkspring-expression5.1.8.RELEASEspring-expression-5.1.8.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkootspring-boot-starter-test2.1.6.RELEASEspring-boot-starter-test-2.1.6.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkootspring-boot-test2.1.6.RELEASEspring-boot-test-2.1.6.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkootspring-boot-test-autoconfigure2.1.6.RELEASEspring-boot-test-autoconfigure-2.1.6.RELEASE.jar;D:mavenapache-maven-3.5.4 epositorycomjaywayjsonpathjson-path2.4.0json-path-2.4.0.jar;D:mavenapache-maven-3.5.4 epository etminidevjson-smart2.3json-smart-2.3.jar;D:mavenapache-maven-3.5.4 epository etminidevaccessors-smart1.2accessors-smart-1.2.jar;D:mavenapache-maven-3.5.4 epositoryorgow2asmasm5.0.4asm-5.0.4.jar;D:mavenapache-maven-3.5.4 epositoryorgslf4jslf4j-api1.7.26slf4j-api-1.7.26.jar;D:mavenapache-maven-3.5.4 epositoryjunitjunit4.12junit-4.12.jar;D:mavenapache-maven-3.5.4 epositoryorgassertjassertj-core3.11.1assertj-core-3.11.1.jar;D:mavenapache-maven-3.5.4 epositoryorgmockitomockito-core2.23.4mockito-core-2.23.4.jar;D:mavenapache-maven-3.5.4 epository etytebuddyyte-buddy1.9.13yte-buddy-1.9.13.jar;D:mavenapache-maven-3.5.4 epository etytebuddyyte-buddy-agent1.9.13yte-buddy-agent-1.9.13.jar;D:mavenapache-maven-3.5.4 epositoryorgobjenesisobjenesis2.6objenesis-2.6.jar;D:mavenapache-maven-3.5.4 epositoryorghamcresthamcrest-core1.3hamcrest-core-1.3.jar;D:mavenapache-maven-3.5.4 epositoryorghamcresthamcrest-library1.3hamcrest-library-1.3.jar;D:mavenapache-maven-3.5.4 epositoryorgskyscreamerjsonassert1.5.0jsonassert-1.5.0.jar;D:mavenapache-maven-3.5.4 epositorycomvaadinexternalgoogleandroid-json .0.20131108.vaadin1android-json-0.0.20131108.vaadin1.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkspring-core5.1.8.RELEASEspring-core-5.1.8.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkspring-jcl5.1.8.RELEASEspring-jcl-5.1.8.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkspring-test5.1.8.RELEASEspring-test-5.1.8.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgxmlunitxmlunit-core2.6.2xmlunit-core-2.6.2.jar;D:mavenapache-maven-3.5.4 epositoryorgprojectlomboklombok1.18.8lombok-1.18.8.jar;D:mavenapache-maven-3.5.4 epositorymysqlmysql-connector-java8.0.16mysql-connector-java-8.0.16.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkootspring-boot-starter-data-jpa2.1.6.RELEASEspring-boot-starter-data-jpa-2.1.6.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkootspring-boot-starter-aop2.1.6.RELEASEspring-boot-starter-aop-2.1.6.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgaspectjaspectjweaver1.9.4aspectjweaver-1.9.4.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkootspring-boot-starter-jdbc2.1.6.RELEASEspring-boot-starter-jdbc-2.1.6.RELEASE.jar;D:mavenapache-maven-3.5.4 epositorycomzaxxerHikariCP3.2.0HikariCP-3.2.0.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkspring-jdbc5.1.8.RELEASEspring-jdbc-5.1.8.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryjavax ransactionjavax.transaction-api1.3javax.transaction-api-1.3.jar;D:mavenapache-maven-3.5.4 epositoryjavaxxmlindjaxb-api2.3.1jaxb-api-2.3.1.jar;D:mavenapache-maven-3.5.4 epositoryjavaxactivationjavax.activation-api1.2.0javax.activation-api-1.2.0.jar;D:mavenapache-maven-3.5.4 epositoryorghibernatehibernate-core5.3.10.Finalhibernate-core-5.3.10.Final.jar;D:mavenapache-maven-3.5.4 epositoryjavaxpersistencejavax.persistence-api2.2javax.persistence-api-2.2.jar;D:mavenapache-maven-3.5.4 epositoryorgjavassistjavassist3.23.2-GAjavassist-3.23.2-GA.jar;D:mavenapache-maven-3.5.4 epositoryantlrantlr2.7.7antlr-2.7.7.jar;D:mavenapache-maven-3.5.4 epositoryorgjbossjandex2.0.5.Finaljandex-2.0.5.Final.jar;D:mavenapache-maven-3.5.4 epositoryorgdom4jdom4j2.1.1dom4j-2.1.1.jar;D:mavenapache-maven-3.5.4 epositoryorghibernatecommonhibernate-commons-annotations5.0.4.Finalhibernate-commons-annotations-5.0.4.Final.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkdataspring-data-jpa2.1.9.RELEASEspring-data-jpa-2.1.9.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkdataspring-data-commons2.1.9.RELEASEspring-data-commons-2.1.9.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkspring-orm5.1.8.RELEASEspring-orm-5.1.8.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkspring-tx5.1.8.RELEASEspring-tx-5.1.8.RELEASE.jar;D:mavenapache-maven-3.5.4 epositoryorgspringframeworkspring-aspects5.1.8.RELEASEspring-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:iehlideaworkspacedinner argetclassescomiedinnerDinnerApplication.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:iehlideaworkspacedinner) 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 * <code>AUTO</code> 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 提供特定的数据库产生主键, 该方式更有利于数据库的移植。
待续.......