爲何JPA無法自動生成表? 40C

1.ERROR MESSAGE

請大家注意下面報錯其中有“2019-09-18 06:01:52.776 WARN 12248 --- [ main] o.h.b.i.SessionFactoryBuilderImpl : Unrecognized hbm2ddl_auto value : update . Supported values include create, create-drop, update, and validate. Ignoring”。

. ____ _ __ _ _
/\ / ' __ _ ()_ __ __ _ \ \ \ \
( ( )\
_ | '_ | '_| | '_ \/ ` | \ \ \ \
\/ _
_)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |___, | / / / /
=========|_|==============|___/=/_/_/_/
:: Spring Boot :: (v1.5.21.RELEASE)

2019-09-18 06:01:37.455 INFO 12248 --- [ main] c.s.mirrorworld.mirrorworldApplication : Starting mirrorworldApplication on LAPTOP-FAS0SHLM with PID 12248 (C:\Users\yueho\eclipse-workspace\mirrorworld\target\classes started by yueho in C:\Users\yueho\eclipse-workspace\mirrorworld)
2019-09-18 06:01:37.466 INFO 12248 --- [ main] c.s.mirrorworld.mirrorworldApplication : No active profile set, falling back to default profiles: default
2019-09-18 06:01:37.766 INFO 12248 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.springframework.context.annotation.AnnotationConfigApplicationContext@2f217633: startup date [Wed Sep 18 06:01:37 CST 2019]; root of context hierarchy
2019-09-18 06:01:43.613 INFO 12248 --- [ main] j.LocalContainerEntityManagerFactoryBean : Building JPA container EntityManagerFactory for persistence unit 'default'
2019-09-18 06:01:43.662 INFO 12248 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [
name: default
...]
2019-09-18 06:01:43.955 INFO 12248 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.0.12.Final}
2019-09-18 06:01:43.959 INFO 12248 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found
2019-09-18 06:01:43.962 INFO 12248 --- [ main] org.hibernate.cfg.Environment : HHH000021: Bytecode provider name : javassist
2019-09-18 06:01:44.282 INFO 12248 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.1.Final}
2019-09-18 06:01:51.899 INFO 12248 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect
2019-09-18 06:01:52.776 WARN 12248 --- [ main] o.h.b.i.SessionFactoryBuilderImpl : Unrecognized hbm2ddl_auto value : update . Supported values include create, create-drop, update, and validate. Ignoring
2019-09-18 06:01:53.639 INFO 12248 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'
2019-09-18 06:01:58.151 INFO 12248 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup
2019-09-18 06:01:58.180 INFO 12248 --- [ main] c.s.mirrorworld.mirrorworldApplication : Started mirrorworldApplication in 21.641 seconds (JVM running for 23.004)
2019-09-18 06:02:20.999 INFO 12248 --- [WT-EventQueue-0] o.h.h.i.QueryTranslatorFactoryInitiator : HHH000397: Using ASTQueryTranslatorFactory
Hibernate: select unit_quant0_.id as id1_18_, unit_quant0_.formula as formula2_18_, unit_quant0_.name as name3_18_, unit_quant0_.symbol as symbol4_18_, unit_quant0_.unit_quantity_type as unit_qua5_18_ from unit_quantity unit_quant0_ where unit_quant0_.id=?
2019-09-18 06:02:21.607 WARN 12248 --- [WT-EventQueue-0] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 1146, SQLState: 42S02
2019-09-18 06:02:21.607 ERROR 12248 --- [WT-EventQueue-0] o.h.engine.jdbc.spi.SqlExceptionHelper : Table 'mirrorworld.unit_quantity' doesn't exist
Exception in thread "AWT-EventQueue-0" javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602)
at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:492)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:375)
at com.sun.proxy.$Proxy86.getResultList(Unknown Source)
at com.stepforward.mirrorworld.p2_base_bean.Thing_Persistence_Service.Simply_get_thing_list(Thing_Persistence_Service.java:498)
at com.stepforward.mirrorworld.p2_base_bean.Thing_Persistence_Service.Get_thing_list_simpler_query_string(Thing_Persistence_Service.java:461)
at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_value_duplication_checking(Thing_Aspect.java:290)
at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_value(Thing_Aspect.java:157)
at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_values(Thing_Aspect.java:116)
at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_values_before_saving(Thing_Aspect.java:74)
at com.stepforward.mirrorworld.p2_base_bean.Thing_List_Service.Save_thing_list(Thing_List_Service.java:470)
at com.stepforward.mirrorworld.p2_base_bean.Thing_List_Service.Manage_user_intention(Thing_List_Service.java:68)
at com.stepforward.mirrorworld.p2_base_bean.Thing_Editor_Dispatcher.Manage_user_intention(Thing_Editor_Dispatcher.java:28)
at com.stepforward.mirrorworld.p4_view.Listener_Thing_List_Editor_View_Button.actionPerformed(Listener_Thing_List_Editor_View_Button.java:38)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
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:109)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:95)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:79)
at org.hibernate.loader.Loader.getResultSet(Loader.java:2117)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1900)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1876)
at org.hibernate.loader.Loader.doQuery(Loader.java:919)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336)
at org.hibernate.loader.Loader.doList(Loader.java:2617)
at org.hibernate.loader.Loader.doList(Loader.java:2600)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2429)
at org.hibernate.loader.Loader.list(Loader.java:2424)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371)
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1326)
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87)
at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606)
at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483)
... 52 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mirrorworld.unit_quantity' doesn't exist
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
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:944)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2495)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1903)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2011)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114)
at com.sun.proxy.$Proxy87.executeQuery(Unknown Source)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70)
... 68 more
Hibernate: select unit_quant0_.id as id1_18_, unit_quant0_.formula as formula2_18_, unit_quant0_.name as name3_18_, unit_quant0_.symbol as symbol4_18_, unit_quant0_.unit_quantity_type as unit_qua5_18_ from unit_quantity unit_quant0_ where unit_quant0_.id=?
2019-09-18 06:02:22.120 WARN 12248 --- [WT-EventQueue-0] o.h.engine.jdbc.spi.SqlExceptionHelper : SQL Error: 1146, SQLState: 42S02
2019-09-18 06:02:22.121 ERROR 12248 --- [WT-EventQueue-0] o.h.engine.jdbc.spi.SqlExceptionHelper : Table 'mirrorworld.unit_quantity' doesn't exist
Exception in thread "AWT-EventQueue-0" javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1692)
at org.hibernate.jpa.spi.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1602)
at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:492)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.orm.jpa.SharedEntityManagerCreator$DeferredQueryInvocationHandler.invoke(SharedEntityManagerCreator.java:375)
at com.sun.proxy.$Proxy86.getResultList(Unknown Source)
at com.stepforward.mirrorworld.p2_base_bean.Thing_Persistence_Service.Simply_get_thing_list(Thing_Persistence_Service.java:498)
at com.stepforward.mirrorworld.p2_base_bean.Thing_Persistence_Service.Get_thing_list_simpler_query_string(Thing_Persistence_Service.java:461)
at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_value_duplication_checking(Thing_Aspect.java:290)
at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_value(Thing_Aspect.java:157)
at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_values(Thing_Aspect.java:116)
at com.stepforward.mirrorworld.p3_application_bean.Thing.Thing_Aspect.Verify_component_values_before_saving(Thing_Aspect.java:74)
at com.stepforward.mirrorworld.p2_base_bean.Thing_List_Service.Save_thing_list(Thing_List_Service.java:470)
at com.stepforward.mirrorworld.p2_base_bean.Thing_List_Service.Manage_user_intention(Thing_List_Service.java:68)
at com.stepforward.mirrorworld.p2_base_bean.Thing_Editor_Dispatcher.Manage_user_intention(Thing_Editor_Dispatcher.java:28)
at com.stepforward.mirrorworld.p4_view.Listener_Thing_List_Editor_View_Button.actionPerformed(Listener_Thing_List_Editor_View_Button.java:38)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6533)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6298)
at java.awt.Container.processEvent(Container.java:2236)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2294)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
at java.awt.Container.dispatchEventImpl(Container.java:2280)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.awt.EventQueue$4.run(EventQueue.java:729)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: org.hibernate.exception.SQLGrammarException: could not extract ResultSet
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:109)
at org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:95)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:79)
at org.hibernate.loader.Loader.getResultSet(Loader.java:2117)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1900)
at org.hibernate.loader.Loader.executeQueryStatement(Loader.java:1876)
at org.hibernate.loader.Loader.doQuery(Loader.java:919)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:336)
at org.hibernate.loader.Loader.doList(Loader.java:2617)
at org.hibernate.loader.Loader.doList(Loader.java:2600)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2429)
at org.hibernate.loader.Loader.list(Loader.java:2424)
at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:501)
at org.hibernate.hql.internal.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:371)
at org.hibernate.engine.query.spi.HQLQueryPlan.performList(HQLQueryPlan.java:216)
at org.hibernate.internal.SessionImpl.list(SessionImpl.java:1326)
at org.hibernate.internal.QueryImpl.list(QueryImpl.java:87)
at org.hibernate.jpa.internal.QueryImpl.list(QueryImpl.java:606)
at org.hibernate.jpa.internal.QueryImpl.getResultList(QueryImpl.java:483)
... 52 more
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'mirrorworld.unit_quantity' doesn't exist
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
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:944)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3978)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3914)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2530)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2683)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2495)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1903)
at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:2011)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tomcat.jdbc.pool.StatementFacade$StatementProxy.invoke(StatementFacade.java:114)
at com.sun.proxy.$Proxy87.executeQuery(Unknown Source)
at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.extract(ResultSetReturnImpl.java:70)
... 68 more
2019-09-18 06:02:23.818 INFO 12248 --- [ Thread-4] s.c.a.AnnotationConfigApplicationContext : Closing org.springframework.context.annotation.AnnotationConfigApplicationContext@2f217633: startup date [Wed Sep 18 06:01:37 CST 2019]; root of context hierarchy
2019-09-18 06:02:23.821 INFO 12248 --- [ Thread-4] o.s.j.e.a.AnnotationMBeanExporter : Unregistering JMX-exposed beans on shutdown
2019-09-18 06:02:23.849 INFO 12248 --- [ Thread-4] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'

2.APPLICATION PROPERTIES

spring.datasource.url=jdbc:mysql://127.0.0.1:3306/mirrorworld
spring.datasource.username=root
spring.datasource.password=mirror
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.max-idle=10
spring.datasource.max-wait=10000
spring.datasource.min-idle=5
spring.datasource.initial-size=5
server.port=8011
server.session.timeout=10
server.tomcat.uri-encoding=UTF-8
spring.jpa.database=MYSQL
spring.jpa.show-sql=true
spring.jpa.hibernate.format_sql=false
spring.jpa.generate-ddl=true

spring.jpa.hibernate.ddl-auto=update

spring.jpa.hibernate.naming_strategy=org.hibernate.cfg.ImprovedNamingStrategy

spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect

3.APPLICATION

@EntityScan
( basePackages =
{
"com.stepforward.mirrorworld.p3_application_bean.Unit"
}
)
@EnableJpaRepositories
(
basePackages =
{
"com.stepforward.mirrorworld.p3_application_bean.Unit"
}
)

@SpringBootApplication
public class mirrorworldApplication
{
......
}

4.ENTITY

@Entity
public class Unit_Quantity extends Thing
{
@Id
@GenericGenerator(name="assigned", strategy="assigned")
@GeneratedValue(generator="assigned")
@Column(nullable=false,length=100)
private String Id;

@Column(nullable=false,length=150)
private String Name;
@Column(nullable=false,length=20)
private String Unit_Quantity_Type;
@Column(nullable=false,length=20)
private String Symbol;
@Column(nullable=true,length=100)
private String Formula;
......
}

yuehoiwai
yuehoiwai update后去掉空格,問題解決,謝謝大家。
大约 2 个月之前 回复

3个回答

看一下这里吧,https://www.cnblogs.com/sunny1009/articles/7802763.html
@Table注解写上

yuehoiwai
yuehoiwai 回复doncha: 明白,謝謝。
大约 2 个月之前 回复
doncha
doncha 回复yuehoiwai: ....发到github上,或者上传到网盘让别人可以下载啊
大约 2 个月之前 回复
yuehoiwai
yuehoiwai 回复doncha: 謝謝你,但請教如何“把项目发到网上”?我是用eclipse的。
大约 2 个月之前 回复
doncha
doncha 回复yuehoiwai: 如果还是查询不出来,就把项目发到网上吧,找个时间帮你看下
大约 2 个月之前 回复
doncha
doncha 回复yuehoiwai: 看下自己的maven依赖配置有没有配对,spring-boot-starter-jdbc,spring-boot-starter-data-jpa包有没有引入。@Entity注解是不是用的javax.persistence的,数据库连接有没有配置正确。
大约 2 个月之前 回复
doncha
doncha 回复yuehoiwai: 我自己昨天去配置了一下spring boot+jpa+hibernate,配置完成运行没问题呀,spring boot启动之后扫描到Entity注解,如果数据库没这个表就会去创建一个表。
大约 2 个月之前 回复
yuehoiwai
yuehoiwai @Table注解写上,但是沒有用,再運行又報錯,其中有莫名其妙的”Unrecognized hbm2ddl_auto value : update“。
大约 2 个月之前 回复

报错是'mirrorworld.unit_quantity找不到这个表。检查一下这个表的实体类是不是有@Table注解

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!