扫码一下
查看教程更方便
现在我们直接使用 idea 启动服务来测试之前介绍的 eclipselink 项目
. ____ _ __ _ _
/\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
\\/ ___)| |_)| | | | | || (_| | ) ) ) )
' |____| .__|_| |_|_| |_\__, | / / / /
=========|_|==============|___/=/_/_/_/
:: spring boot :: (v2.6.6)
...
2021-05-04 09:52:28.187 info 10048 --- [ restartedmain] w.s.c.servletwebserverapplicationcontext : root webapplicationcontext: initialization completed in 3111 ms
...
[el info]: 2021-05-04 09:52:29.063--serversession(2026366076)--thread(thread[restartedmain,5,main])--eclipselink, version: eclipse persistence services - 2.7.8.v20201217-ecdf3c32c4
...
[el config]: connection: 2021-05-04 09:52:29.424--serversession(2026366076)--connection(460137428)--thread(thread[restartedmain,5,main])--connected: jdbc:mysql://localhost:3306/jiyik?usessl=false&allowpublickeyretrieval=true
user: root@localhost
database: mysql version: 8.0.23
driver: mysql connector/j version: mysql-connector-java-8.0.26 (revision: 9aae1e450989d62c06616c1dcda3e404ef84df70)
[el fine]: connection: 2021-05-04 09:52:29.471--serversession(2026366076)--thread(thread[restartedmain,5,main])--/file:/f:/tutorialspoint/springbootorm/target/classes/_default login successful
[el finer]: metamodel: 2021-05-04 09:52:29.512--serversession(2026366076)--thread(thread[restartedmain,5,main])--canonical metamodel class [com.tutorialspoint.springbootorm.entity.employee_] not found during initialization.
2021-05-04 09:52:29.796 warn 10048 --- [ restartedmain] jpabaseconfiguration$jpawebconfiguration : 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
2021-05-04 09:52:30.543 info 10048 --- [ restartedmain] o.s.b.d.a.optionallivereloadserver : livereload server is running on port 35729
2021-05-04 09:52:30.603 info 10048 --- [ restartedmain] o.s.b.w.embedded.tomcat.tomcatwebserver : tomcat started on port(s): 8080 (http) with context path ''
2021-05-04 09:52:30.622 info 10048 --- [ restartedmain] c.t.s.springbootormapplication : started springbootormapplication in 6.556 seconds (jvm running for 7.512)
2021-05-04 09:53:38.526 info 10048 --- [nio-8080-exec-1] o.a.c.c.c.[tomcat].[localhost].[/] : initializing spring dispatcherservlet 'dispatcherservlet'
2021-05-04 09:53:38.527 info 10048 --- [nio-8080-exec-1] o.s.web.servlet.dispatcherservlet : initializing servlet 'dispatcherservlet'
2021-05-04 09:53:38.532 info 10048 --- [nio-8080-exec-1] o.s.web.servlet.dispatcherservlet : completed initialization in 5 ms
服务器启动并运行后,使用 apifox 发出 get 请求以获取所有记录。
在 apifox 中设置以下参数。
http://localhost:8080/emp/employees
单击发送按钮并验证响应。
[{
"id": 1,
"age": 35,
"name": "julie",
"email": "julie@gmail.com"
}]