@GET
@Path("findByNameANDCode/{studname}/{studpostcode}")
@Produces({"application/json"})
public List findByNameANDCode(@PathParam("studname") String
studname, @PathParam("studpostcode") Integer studpostcode) {
Query query = em.createNamedQuery("Student.findByNameANDCode");
query.setParameter("studname", studname);
query.setParameter("studpostcode", studpostcode);
return query.getResultList();
}
在这段代码中,我想将{studname}/{studpostcode}改为一个{choice},如果用户在choice中输入studname,将自动选择studname table;输入studpostcode的时候将自动选择studpostcode table,请问该如何通过if语句实现呢?