This is what I'm trying to do
I have an entity
@Entity public class JobEntity { @Id @GeneratedValue private Long id; @Enumerated(EnumType.STRING) private Project project; @Enumerated(EnumType.STRING) private JobType jobType; @Enumerated(EnumType.STRING) private JobStatus jobStatus; private Date createTime; }
I know that I can configure one request in the repository, but this is just one fixed request. I hope to export some RESTful api as below,
/search?project=""&jobType=""&jobStatue=""&createTime=""
These parameters should not be forced and can easily use any of them to execute a request, for example
/search?createTime=""...
Is there an elegant way to implement this?
java spring rest spring-boot spring-data-jpa
Man shen
source share