We have two Spring Boot applications with a client-server architecture. The backend is configured with Spring Data REST + JPA. The front end should consume the resources exposed by the backend and serve a public REST api.
Is it possible to have Spring data map the domain objects automatically from DTOs by declaring, e.g., a mapper bean?
// JPA persistable
@Entity
public class Order { .. }
// Immutable DTO
public class OrderDto { .. }
// Is this somehow possible..
@RepositoryRestResource
public interface OrderDtoRepository extends CrudRepository<OrderDto, Long> {}
// .. instead of this?
@RepositoryRestResource
public interface OrderRepository extends CrudRepository<Order, Long> {}