Spring Boot ORM - Test EclipseLink


Advertisements

Now in eclipse, right click on the SpringBootOrmApplication.java, select Run As context menu, and select Java Application. Check the console logs in the eclipse. You can see the below logs −


  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::                (v2.5.5)

...
2021-10-06 09:52:28.187  INFO 10048 --- [  restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 3111 ms
...
[EL Info]: 2021-10-06 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-10-06 09:52:29.424--ServerSession(2026366076)--Connection(460137428)--Thread(Thread[restartedMain,5,main])--Connected: jdbc:mysql://localhost:3306/tutorialspoint?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-10-06 09:52:29.471--ServerSession(2026366076)--Thread(Thread[restartedMain,5,main])--/file:/F:/tutorialspoint/springbootorm/target/classes/_default login successful
[EL Finer]: metamodel: 2021-10-06 09:52:29.512--ServerSession(2026366076)--Thread(Thread[restartedMain,5,main])--Canonical Metamodel class [com.tutorialspoint.springbootorm.entity.Employee_] not found during initialization.
2021-10-06 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-10-06 09:52:30.543  INFO 10048 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2021-10-06 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-10-06 09:52:30.622  INFO 10048 --- [  restartedMain] c.t.s.SpringBootOrmApplication           : Started SpringBootOrmApplication in 6.556 seconds (JVM running for 7.512)
2021-10-06 09:53:38.526  INFO 10048 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2021-10-06 09:53:38.527  INFO 10048 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2021-10-06 09:53:38.532  INFO 10048 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 5 ms

Once server is up and running, Use Postman to make a GET request to get all records.

Set the following parameters in POSTMAN.

  • HTTP Method − GET

  • URL − http://localhost:8080/emp/employees

Click the send button and verify the response.

[{  
   "id": 1,  
   "age": 35,  
   "name": "Julie",  
   "email": "julie@gmail.com"  
}]   
Advertisements