mirror of
https://git.imnavajas.es/jjimenez/erp-imprimelibros.git
synced 2026-01-13 08:58:48 +00:00
ya obtengo los datos de los anonimos, falta formatear esos datos y buscar
This commit is contained in:
@ -33,6 +33,12 @@ public class DataTable<T> {
|
||||
.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
|
||||
private List<String> orderable = null;
|
||||
|
||||
private boolean onlyAdded = false;
|
||||
public DataTable<T> onlyAddedColumns(){
|
||||
this.onlyAdded = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
private DataTable(JpaSpecificationExecutor<T> repo, Class<T> entityClass, DataTablesRequest dt,
|
||||
List<String> searchable) {
|
||||
this.repo = repo;
|
||||
@ -148,7 +154,7 @@ public class DataTable<T> {
|
||||
// Mapear entidad -> Map base (via Jackson) + add/edit
|
||||
List<Map<String, Object>> data = new ArrayList<>();
|
||||
for (T e : p.getContent()) {
|
||||
Map<String, Object> row = om.convertValue(e, Map.class);
|
||||
Map<String, Object> row = onlyAdded ? new HashMap<>() : om.convertValue(e, Map.class);
|
||||
row.put("__entity", e); // para editores que necesiten la entidad
|
||||
for (var ad : adders)
|
||||
row.putAll(ad.apply(e));
|
||||
|
||||
Reference in New Issue
Block a user