采纳答案成功!
向帮助你的同学说点啥吧!感谢那些助人为乐的人
控制台没有生成sql语句,没有生成表,配置都配了,也reimport了
2019-06-25 23:55:34.751 INFO 6956 --- [ main] c.e.chapter012.Chapter012Application : Starting Chapter012Application on LAPTOP-B152PGJK with PID 6956 (D:\chapter01-2\target\classes started by Chao 7000 in D:\chapter01-2) 2019-06-25 23:55:34.755 INFO 6956 --- [ main] c.e.chapter012.Chapter012Application : The following profiles are active: dev 2019-06-25 23:55:35.651 INFO 6956 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode. 2019-06-25 23:55:35.677 INFO 6956 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 17ms. Found 0 repository interfaces. 2019-06-25 23:55:36.094 INFO 6956 --- [ main] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$ad73489f] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying) 2019-06-25 23:55:36.535 INFO 6956 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8081 (http) 2019-06-25 23:55:36.564 INFO 6956 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2019-06-25 23:55:36.564 INFO 6956 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.16] 2019-06-25 23:55:36.574 INFO 6956 --- [ main] o.a.catalina.core.AprLifecycleListener : The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [D:\JDK1.8\bin;C:\windows\Sun\Java\bin;C:\windows\system32;C:\windows;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\iCLS\;C:\Program Files\Intel\Intel(R) Management Engine Components\iCLS\;C:\windows\system32;C:\windows;C:\windows\System32\Wbem;C:\windows\System32\WindowsPowerShell\v1.0\;C:\windows\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\Users\Chao 7000\AppData\Local\Microsoft\WindowsApps;D:\JDK1.8\bin;D:\maven\apache-maven-3.6.0\bin;;.] 2019-06-25 23:55:36.845 INFO 6956 --- [ main] o.a.c.c.C.[.[localhost].[/luckymoney] : Initializing Spring embedded WebApplicationContext 2019-06-25 23:55:36.845 INFO 6956 --- [ main] o.s.web.context.ContextLoader : Root WebApplicationContext: initialization completed in 2028 ms 2019-06-25 23:55:37.043 INFO 6956 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting... 2019-06-25 23:55:37.221 INFO 6956 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed. 2019-06-25 23:55:37.285 INFO 6956 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [ name: default ...] 2019-06-25 23:55:37.470 INFO 6956 --- [ main] org.hibernate.Version : HHH000412: Hibernate Core {5.3.7.Final} 2019-06-25 23:55:37.471 INFO 6956 --- [ main] org.hibernate.cfg.Environment : HHH000206: hibernate.properties not found 2019-06-25 23:55:37.688 INFO 6956 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.0.4.Final} 2019-06-25 23:55:37.900 INFO 6956 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.MySQL5Dialect 2019-06-25 23:55:38.738 INFO 6956 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default' 2019-06-25 23:55:39.008 INFO 6956 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2019-06-25 23:55:39.053 WARN 6956 --- [ main] aWebConfiguration$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 2019-06-25 23:55:39.305 INFO 6956 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8081 (http) with context path '/luckymoney' 2019-06-25 23:55:39.308 INFO 6956 --- [ main] c.e.chapter012.Chapter012Application : Started Chapter012Application in 5.231 seconds (JVM running for 7.065)
spring: datasource: driver-class-name: com.mysql.cj.jdbc.Driver url: jdbc:mysql://localhost:3306/luckymoney?serverTimezone=GMT username: root password: admin jpa: hibernate: ddl-auto: update show-sql: true
package com.example.chapter012; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import java.math.BigDecimal; @Entity public class Luckymoney { @Id @GeneratedValue private Integer id; private BigDecimal money; private String producer; private String consumer; public Luckymoney() { } public Integer getId() { return id; } public void setId(Integer id) { this.id = id; } public BigDecimal getMoney() { return money; } public void setMoney(BigDecimal money) { this.money = money; } public String getProducer() { return producer; } public void setProducer(String producer) { this.producer = producer; } public String getConsumer() { return consumer; } public void setConsumer(String consumer) { this.consumer = consumer; } }
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>2.1.3.RELEASE</version> <relativePath/> <!-- lookup parent from repository --> </parent> <groupId>com.example</groupId> <artifactId>chapter01-2</artifactId> <version>0.0.1-SNAPSHOT</version> <name>chapter01-2</name> <description>Demo project for Spring Boot</description> <properties> <java.version>1.8</java.version> </properties> <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-test</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jpa</artifactId> </dependency> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> </plugin> </plugins> </build> </project>
把具体的问题截图看下哇
稍等一下哈,第一次用这个,回复里好像发不了图,只能在添加回答里贴图
图我上传了,麻烦有空看一下,菜鸟一枚,请大佬指教!
登录后可查看更多问答,登录/注册
一切为了效率!两个小时学习SpringBoot,为你省时省力Get干货
2.0k 9
2.3k 8
801 8
1.1k 8
784 7