static JsonObject fromJson(final JsonObject criteria, final String pojo) { final Mojo mojo = Mirror.create(From.class).mount(pojo).mojo(); return Query.criteria(criteria, mojo); } }
static JsonObject fromJson(final JsonObject criteria, final String pojo) { final Mojo mojo = Mirror.create(From.class).mount(pojo).mojo(); return Query.criteria(criteria, mojo); } }
void bind(final String pojo, final Class<?> clazz) { if (Ut.isNil(pojo)) { this.pojoFile = null; this.pojo = null; } else { LOGGER.debug(Info.JOOQ_BIND, pojo, clazz); this.pojoFile = pojo; this.pojo = Mirror.create(UxJooq.class).mount(pojo) .mojo().put(this.mapping); // When bind pojo, the system will analyze columns LOGGER.debug(Info.JOOQ_MOJO, this.pojo.getRevert(), this.pojo.getColumns()); } }
void bind(final String pojo, final Class<?> clazz) { if (Ut.isNil(pojo)) { this.pojoFile = null; this.pojo = null; } else { LOGGER.debug(Info.JOOQ_BIND, pojo, clazz); this.pojoFile = pojo; this.pojo = Mirror.create(UxJooq.class).mount(pojo) .mojo().put(this.mapping); // When bind pojo, the system will analyze columns LOGGER.debug(Info.JOOQ_MOJO, this.pojo.getRevert(), this.pojo.getColumns()); } }
static Inquiry getInquiry(final JsonObject envelop, final String pojo) { return Fn.getNull(Inquiry.create(new JsonObject()), () -> { final JsonObject data = envelop.copy(); if (Ut.isNil(pojo)) { return Inquiry.create(data); } else { // Projection Process final Mojo mojo = Mirror.create(Query.class).mount(pojo).mojo(); if (data.containsKey("projection")) { data.put("projection", projection(data.getJsonArray("projection"), mojo)); } if (data.containsKey("sorter")) { data.put("sorter", sorter(data.getJsonArray("sorter"), mojo)); } if (data.containsKey("criteria")) { data.put("criteria", criteria(data.getJsonObject("criteria"), mojo)); } LOGGER.info(Info.INQUIRY_MESSAGE, data.encode()); return Inquiry.create(data); } }, envelop); }
static Inquiry getInquiry(final JsonObject envelop, final String pojo) { return Fn.getNull(Inquiry.create(new JsonObject()), () -> { final JsonObject data = envelop.copy(); if (Ut.isNil(pojo)) { return Inquiry.create(data); } else { // Projection Process final Mojo mojo = Mirror.create(Query.class).mount(pojo).mojo(); if (data.containsKey("projection")) { data.put("projection", projection(data.getJsonArray("projection"), mojo)); } if (data.containsKey("sorter")) { data.put("sorter", sorter(data.getJsonArray("sorter"), mojo)); } if (data.containsKey("criteria")) { data.put("criteria", criteria(data.getJsonObject("criteria"), mojo)); } LOGGER.info(Info.INQUIRY_MESSAGE, data.encode()); return Inquiry.create(data); } }, envelop); }