public static Mirror create(final Class<?> clazz) { return new Mirror(clazz); }
public Mirror from() { this.convert(this.mojo.getRevert()); return this; }
public Mirror from() { this.convert(this.mojo.getRevert()); return this; }
public Mirror to() { this.convert(this.mojo.getMapper()); return this; }
public static Mirror create(final Class<?> clazz) { return new Mirror(clazz); }
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()); } }
public Mirror to() { this.convert(this.mojo.getMapper()); return this; }
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); }