Separate RecentActivityTableRequest's offset to dmp and dataset offset (backend)

This commit is contained in:
George Kalampokis 2020-07-22 10:28:25 +03:00
parent a60151560b
commit f3c1244600
2 changed files with 16 additions and 7 deletions

View File

@ -224,7 +224,7 @@ public class DashBoardManager {
recentActivityModels.addAll(dmpList
.withHint(HintedModelFactory.getHint(RecentDmpModel.class))
.orderBy((builder, root) -> builder.desc(root.get(tableRequest.getCriteria().getOrder())))
.skip(tableRequest.getOffset())
.skip(tableRequest.getDmpOffset())
.take(tableRequest.getLength())
.select(item -> {
return new RecentDmpModel().fromEntity(item);
@ -233,7 +233,7 @@ public class DashBoardManager {
recentActivityModels.addAll(datasetList
.withHint(HintedModelFactory.getHint(RecentDatasetModel.class))
.orderBy((builder, root) -> builder.desc(root.get(tableRequest.getCriteria().getOrder())))
.skip(tableRequest.getOffset())
.skip(tableRequest.getDatasetOffset())
.take(tableRequest.getLength())
.select(item -> {
return new RecentDatasetModel().fromEntity(item);

View File

@ -4,15 +4,24 @@ import eu.eudat.criteria.RecentActivityCriteria;
public class RecentActivityTableRequest {
private RecentActivityCriteria criteria;
private int offset;
private int dmpOffset;
private int datasetOffset;
private int length;
public int getOffset() {
return offset;
public int getDmpOffset() {
return dmpOffset;
}
public void setOffset(int offset) {
this.offset = offset;
public void setDmpOffset(int dmpOffset) {
this.dmpOffset = dmpOffset;
}
public int getDatasetOffset() {
return datasetOffset;
}
public void setDatasetOffset(int datasetOffset) {
this.datasetOffset = datasetOffset;
}
public int getLength() {