I experimented with spring-data-rest (SDR) and am really impressed with how quickly I can build a rest api. My application is based on the following repository, which gives me GET / attachements and POST / attachements
package com.deepskyblue.attachment.repository;
import java.util.List;
import org.springframework.data.repository.Repository;
import com.deepskyblue.attachment.domain.Attachment;
public interface AttachmentRepository extends Repository<Attachment, Long> {
List<Attachment> findAll();
Attachment save(Attachment attachment);
}
One thing I'm confusing is how I add custom business logic. The SDR seems great if I just want to use the remainder API for my data, however a traditional Spring application usually has a service level where I can have business logic. Is there any way to add this business logic to the SDR?
source
share