Skip to content

Tag: spring-boot

How to returnDTO instead of entity in Spring boot pagination?

My DTO is different from entity. How can I return a DTO instead of entity with pagination while still showing information of all pages? Controller: Service: Repository: DTO: Entity: Answer The StudentDTO class can have a constructor with a Student parameter. Then you can call map on the Page object.

Spring boot where is my jar file

Spring boot makes it really easy to setup a simple app. But it takes me longer to actually get a jar file which I can upload to a remote server. I am using IntelliJ, no command line, and I use gradle. The application is running somehow out of Intellij. But where are the created files? Where is my jar from

Spring boot – @Service class calling another @Service class

Is it fine to have a @Service annotated class calling another @Service annotated class? Or it is a bad practice? Eg.: Answer It is not any restriction calling a service from another one. Unless you make circular dependency between services. Circular dependency : https://en.wikipedia.org/wiki/Circular_dependen…