JaxrsConfigEndpoint { @GET @Produces({ APPLICATION_JSON }) @Path("query/{schemaName}") public JaxrsBeans query(@PathParam("schemaName") String schemaName, @QueryParam("q") String query, @QueryParam("first") String first, @QueryParam("max") int max) { max = max == 0 ? Integer.MAX_VALUE : max; JaxrsQuery jaxrsQuery = new JaxrsQuery(query); BeanQuery beanQuery = admin.newQuery(schemaName) .setFirstResult(first) .setMaxResults(max); for (BeanRestriction restriction : jaxrsQuery.getRestrictions()) { beanQuery.add(restriction); } BeanQueryResult result = beanQuery.retrieve(); JaxrsBeans jaxrsBeans = new JaxrsBeans(result.get()); return jaxrsBeans; } @Inject  JaxrsConfigEndpoint(AdminContext admin); @GET @Produces({ APPLICATION_JSON }) @Path("getBean/{schemaName}/{id}") JaxrsBean getBean(@PathParam("schemaName") String schemaName,
                        @PathParam("id") String id); @GET @Produces({ APPLICATION_JSON }) @Path("getSingleton/{className}") JaxrsObject getSingleton(@PathParam("className") String className); @GET @Produces({ APPLICATION_JSON }) @Path("getObject/{className}/{id}") JaxrsObject getObject(@PathParam("className") String className,
                            @PathParam("id") String id); @GET @Produces({ APPLICATION_JSON }) @Path("listBean/{schemaName}") JaxrsBeans listBean(@PathParam("schemaName") String schemaName); @GET @Produces({ APPLICATION_JSON }) @Path("listObjects/{className}") JaxrsObjects listObjects(@PathParam("className") String className); @GET @Produces({ APPLICATION_JSON }) @Path("listBeans/{schemaName}") JaxrsBeans listBeans(@PathParam("schemaName") String schemaName,
                                @QueryParam("id") final List<String> ids); @POST @Consumes({ APPLICATION_JSON }) @Path("createBean") void createBean(JaxrsBean jaxrsBean); @POST @Consumes({ APPLICATION_JSON }) @Path("createObject") void createObject(JaxrsObject jaxrsObject); @POST @Consumes({ APPLICATION_JSON }) @Path("createBeans") void createBeans(JaxrsBeans jaxrsBeans); @POST @Consumes({ APPLICATION_JSON }) @Path("createObjects") void createObjects(JaxrsObjects jaxrsObjects); @POST @Consumes({ APPLICATION_JSON }) @Path("setBean") void setBean(JaxrsBean jaxrsBean); @POST @Consumes({ APPLICATION_JSON }) @Path("setObject") void setObject(JaxrsObject jaxrsObject); @POST @Consumes({ APPLICATION_JSON }) @Path("setBeans") void setBeans(JaxrsBeans jaxrsBeans); @POST @Consumes({ APPLICATION_JSON }) @Path("setObjects") void setObjects(JaxrsObjects jaxrsObjects); @POST @Consumes({ APPLICATION_JSON }) @Path("mergeBean") void mergeBean(JaxrsBean jaxrsBean); @POST @Consumes({ APPLICATION_JSON }) @Path("mergeObject") void mergeObject(JaxrsObject jaxrsObject); @POST @Consumes({ APPLICATION_JSON }) @Path("mergeBeans") void mergeBeans(JaxrsBeans jaxrsBeans); @POST @Consumes({ APPLICATION_JSON }) @Path("mergeObjects") void mergeObjects(JaxrsObjects jaxrsObjects); @DELETE @Consumes({ "*/*" }) @Path("deleteBean/{schemaName}/{id}") void deleteBean(@PathParam("schemaName") String schemaName,
                           @PathParam("id") String id); @DELETE @Consumes({ "*/*" }) @Path("deleteBeans/{schemaName}") void deleteBeans(@PathParam("schemaName") String schemaName,
                            @QueryParam("id") final List<String> ids); @GET @Produces({ APPLICATION_JSON }) @Path("getSchemas") JaxrsSchemas getSchemas(); @GET @Produces({ APPLICATION_JSON }) @Path("getSchema/{schemaName}") JaxrsSchema getSchema(@PathParam("schemaName") String schemaName); @GET @Produces({ APPLICATION_JSON }) @Path("query/{schemaName}") JaxrsBeans query(@PathParam("schemaName") String schemaName, @QueryParam("q") String query,
                            @QueryParam("first") String first, @QueryParam("max") int max); static final String PATH; }
@Test public void testQuery() { }