37 lines
896 B
Java
37 lines
896 B
Java
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
package com.qsoft.erp.dominio.mapper;
|
|
|
|
import com.qsoft.dao.bdd.DaoBDDUtil;
|
|
import java.lang.reflect.Field;
|
|
|
|
/**
|
|
*
|
|
* @author james
|
|
*/
|
|
public class MapperUtil {
|
|
|
|
public static synchronized boolean isEmptyDTO(Object dto) {
|
|
boolean estado = true;
|
|
Object dato;
|
|
|
|
for (Field f : dto.getClass().getDeclaredFields()) {
|
|
try {
|
|
dato = DaoBDDUtil.getValue(f, dto);
|
|
if (dato != null) {
|
|
estado = false;
|
|
break;
|
|
}
|
|
} catch (IllegalArgumentException | IllegalAccessException ex) {
|
|
ex.printStackTrace(System.err);
|
|
}
|
|
}
|
|
|
|
return estado;
|
|
}
|
|
|
|
}
|