コード例 #1
0
 @SuppressWarnings({"unchecked", "rawtypes"})
 public int updateByExample(PO record, PE example) {
   MapperParamMap mpm = new MapperParamMap();
   mpm.put("record", record);
   mpm.put("example", example);
   return super.update(initNamespace(".updateByExample"), mpm);
 }
コード例 #2
0
  @SuppressWarnings("unchecked")
  private Page pageByMetaObject(MetaObject metaObject) {
    DefaultParameterHandler defaultParameterHandler =
        (DefaultParameterHandler) metaObject.getValue("delegate.parameterHandler");
    Object parameterObject = defaultParameterHandler.getParameterObject();
    if (parameterObject != null && parameterObject instanceof MapperParamMap) {
      MapperParamMap resultMap = (MapperParamMap) parameterObject;
      if (!resultMap.containsKey("page")) {
        return null;
      }

      Object pageEx = resultMap.get("page");
      if (pageEx != null) return (Page) pageEx;
    }
    return null;
  }