Skip to content

Commit

Permalink
Mejoras en capa de datos.
Browse files Browse the repository at this point in the history
  • Loading branch information
jencisopy committed Jan 30, 2025
1 parent ab1470f commit 0df3049
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
24 changes: 18 additions & 6 deletions business/src/main/java/org/javabeanstack/data/DataRow.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ public class DataRow implements IDataRow, Cloneable {
@XmlTransient
private Map<String, Object> properties;
@XmlTransient
private String signature="SINFIRMA";
private String signature = "SINFIRMA";

@XmlTransient
private boolean auditable = false;
private Class<? extends IDataRow> auditTable;
Expand Down Expand Up @@ -341,6 +341,18 @@ public Map<String, IErrorReg> getErrors() {
@Override
public void setErrors(Map<String, IErrorReg> errorReg) {
this.errors = errorReg;
if (getErrors() != null && !getErrors().isEmpty()) {
boolean error = false;
for (Map.Entry<String, IErrorReg> entry : errors.entrySet()) {
if (!entry.getValue().isWarning()) {
error = true;
break;
}
}
if (error) {
setRowChecked(false);
}
}
}

/**
Expand Down Expand Up @@ -743,9 +755,9 @@ public String getSignature() {

@Override
public void setSignature(String signature) {
this.signature = signature;
this.signature = signature;
}

@XmlTransient
@Override
public String getTextToSign() {
Expand All @@ -772,7 +784,7 @@ public String getTextToSign() {
} else if (obj instanceof LocalDateTime) {
value = Fn.getValueFormatted(obj, "yyyy-MM-dd'T'HH:mm");
} else {
value = obj.toString().replaceAll("\\s+$",""); //se elimina espacios a la derecha.
value = obj.toString().replaceAll("\\s+$", ""); //se elimina espacios a la derecha.
}
retornar += "{" + field.getName() + ":" + value + "}";
}
Expand All @@ -781,7 +793,7 @@ public String getTextToSign() {
}
}
}
retornar += "{SIGNATURE:"+Fn.nvl(signature, "")+"}";
retornar += "{SIGNATURE:" + Fn.nvl(signature, "") + "}";
return retornar;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -863,6 +863,10 @@ protected boolean beforeLazyRowsLoad() {
return true;
}

protected void afterLazyRowsLoad() {
//Implentar en clases derivadas
}

public void doFilter(String table, String filterTag) {
//Implementar en clases derivadas.
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,7 @@ private List<T> load(int first, int pageSize, String order, Map<String, Object>
}
}
context.setRowSelected(null);
context.afterLazyRowsLoad();
return rows;
} catch (Exception ex) {
ErrorManager.showError(ex, LOGGER);
Expand Down

0 comments on commit 0df3049

Please sign in to comment.