Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
3d56684c15
|
@ -3,11 +3,9 @@ package com.loafle.overflow.proxy.db;
|
|||
import com.loafle.overflow.db.api.DBGrpc;
|
||||
import com.loafle.overflow.db.api.DBInput;
|
||||
import com.loafle.overflow.db.api.DBOutput;
|
||||
|
||||
import com.loafle.overflow.module.domain.dao.DomainDAO;
|
||||
import com.loafle.overflow.module.email.dao.EmailAuthDAO;
|
||||
import com.loafle.overflow.module.member.dao.MemberDAO;
|
||||
|
||||
import com.loafle.overflow.module.noauthprobe.dao.NoAuthProbeDAO;
|
||||
import com.loafle.overflow.module.probe.dao.ProbeDAO;
|
||||
import com.loafle.overflow.module.sensor.dao.SensorDao;
|
||||
|
@ -19,7 +17,6 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
|
|||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
@ -137,22 +134,31 @@ public class DBProxy {
|
|||
paramTypes.add(cls);
|
||||
}
|
||||
|
||||
try {
|
||||
//Check if it belongs to the JPABaseDAO.
|
||||
method = dao.getClass().getSuperclass().getMethod(methodName, Object.class);
|
||||
retObj = method.invoke(dao, valueList.toArray(new Object[valueList.size()]));
|
||||
|
||||
}catch(NoSuchMethodException e) {
|
||||
if(params.size() > 0) {
|
||||
method = dao.getClass().getMethod(methodName, paramTypes.toArray(new Class[paramTypes.size()]));
|
||||
method = dao.getClass().getMethod(methodName, Object.class);
|
||||
//method = dao.getClass().getMethod(methodName, paramTypes.toArray(new Class[paramTypes.size()]));
|
||||
retObj = method.invoke(dao, valueList.toArray(new Object[valueList.size()]));
|
||||
}else {
|
||||
method = dao.getClass().getMethod(methodName);
|
||||
retObj = method.invoke(dao);
|
||||
}
|
||||
}catch(InvocationTargetException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// try {
|
||||
// method = dao.getClass().getSuperclass().getMethod(methodName, Object.class);
|
||||
// retObj = method.invoke(dao, valueList.toArray(new Object[valueList.size()]));
|
||||
//
|
||||
// }catch(NoSuchMethodException e) {
|
||||
// if(params.size() > 0) {
|
||||
// method = dao.getClass().getMethod(methodName, paramTypes.toArray(new Class[paramTypes.size()]));
|
||||
// retObj = method.invoke(dao, valueList.toArray(new Object[valueList.size()]));
|
||||
// }else {
|
||||
// method = dao.getClass().getMethod(methodName);
|
||||
// retObj = method.invoke(dao);
|
||||
// }
|
||||
// }catch(InvocationTargetException e) {
|
||||
// e.printStackTrace();
|
||||
// }
|
||||
|
||||
return mapper.writeValueAsString(retObj);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user