コード例 #1
0
  public static Object translateOutputApp(BaseModel<?> oldModel) {
    Thread currentThread = Thread.currentThread();

    ClassLoader contextClassLoader = currentThread.getContextClassLoader();

    try {
      currentThread.setContextClassLoader(_classLoader);

      try {
        AppClp newModel = new AppClp();

        Class<?> oldModelClass = oldModel.getClass();

        Method method0 = oldModelClass.getMethod("getUuid");

        String value0 = (String) method0.invoke(oldModel, (Object[]) null);

        newModel.setUuid(value0);

        Method method1 = oldModelClass.getMethod("getAppId");

        Long value1 = (Long) method1.invoke(oldModel, (Object[]) null);

        newModel.setAppId(value1);

        Method method2 = oldModelClass.getMethod("getCompanyId");

        Long value2 = (Long) method2.invoke(oldModel, (Object[]) null);

        newModel.setCompanyId(value2);

        Method method3 = oldModelClass.getMethod("getUserId");

        Long value3 = (Long) method3.invoke(oldModel, (Object[]) null);

        newModel.setUserId(value3);

        Method method4 = oldModelClass.getMethod("getUserName");

        String value4 = (String) method4.invoke(oldModel, (Object[]) null);

        newModel.setUserName(value4);

        Method method5 = oldModelClass.getMethod("getCreateDate");

        Date value5 = (Date) method5.invoke(oldModel, (Object[]) null);

        newModel.setCreateDate(value5);

        Method method6 = oldModelClass.getMethod("getModifiedDate");

        Date value6 = (Date) method6.invoke(oldModel, (Object[]) null);

        newModel.setModifiedDate(value6);

        Method method7 = oldModelClass.getMethod("getRemoteAppId");

        Long value7 = (Long) method7.invoke(oldModel, (Object[]) null);

        newModel.setRemoteAppId(value7);

        Method method8 = oldModelClass.getMethod("getVersion");

        String value8 = (String) method8.invoke(oldModel, (Object[]) null);

        newModel.setVersion(value8);

        return newModel;
      } catch (Exception e) {
        _log.error(e, e);
      }
    } finally {
      currentThread.setContextClassLoader(contextClassLoader);
    }

    return oldModel;
  }