FINERACT-1943 Transaction and datatable GET queries
This commit is contained in:
+3
-9
@@ -25,7 +25,6 @@ import java.util.List;
|
||||
import java.util.Optional;
|
||||
import lombok.Data;
|
||||
import org.springframework.data.domain.PageRequest;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.data.domain.Sort;
|
||||
|
||||
@Data
|
||||
@@ -44,7 +43,7 @@ public class PagedRequest<T> {
|
||||
return Optional.ofNullable(request);
|
||||
}
|
||||
|
||||
public Pageable toPageable() {
|
||||
public PageRequest toPageable() {
|
||||
if (isEmpty(sorts)) {
|
||||
return PageRequest.of(page, size);
|
||||
} else {
|
||||
@@ -57,16 +56,11 @@ public class PagedRequest<T> {
|
||||
@SuppressWarnings({ "unused" })
|
||||
private static class SortOrder {
|
||||
|
||||
private Direction direction;
|
||||
private Sort.Direction direction;
|
||||
private String property;
|
||||
|
||||
private enum Direction {
|
||||
ASC, DESC;
|
||||
}
|
||||
|
||||
private Sort.Order toOrder() {
|
||||
Sort.Direction d = Sort.Direction.fromString(direction.name());
|
||||
return new Sort.Order(d, property);
|
||||
return new Sort.Order(direction, property);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+6
-3
@@ -41,11 +41,14 @@ public class DatabaseSpecificSQLGenerator {
|
||||
this.databaseTypeResolver = databaseTypeResolver;
|
||||
}
|
||||
|
||||
public DatabaseType getDialect() {
|
||||
return databaseTypeResolver.databaseType();
|
||||
}
|
||||
|
||||
public String escape(String arg) {
|
||||
DatabaseType dialect = databaseTypeResolver.databaseType();
|
||||
if (dialect.isMySql()) {
|
||||
if (databaseTypeResolver.isMySQL()) {
|
||||
return format("`%s`", arg);
|
||||
} else if (dialect.isPostgres()) {
|
||||
} else if (databaseTypeResolver.isPostgreSQL()) {
|
||||
return format("\"%s\"", arg);
|
||||
}
|
||||
return arg;
|
||||
|
||||
+15
-8
@@ -16,16 +16,23 @@
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*/
|
||||
package org.apache.fineract.infrastructure.core.data;
|
||||
package org.apache.fineract.infrastructure.dataqueries.data;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@AllArgsConstructor
|
||||
@Getter
|
||||
public enum RangeOperator {
|
||||
/**
|
||||
* Immutable data object representing datatable data.
|
||||
*/
|
||||
@Data
|
||||
@NoArgsConstructor
|
||||
public final class ColumnFilter implements Serializable {
|
||||
|
||||
GTE(">="), LTE("<="), GT(">"), LT("<");
|
||||
private String columnName;
|
||||
|
||||
private String columnValue;
|
||||
|
||||
private String columnOperation;
|
||||
|
||||
private final String symbol;
|
||||
}
|
||||
+4
@@ -99,6 +99,10 @@ public enum SavingsAccountTransactionType {
|
||||
return transactionType == null ? INVALID : transactionType;
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return this != INVALID;
|
||||
}
|
||||
|
||||
public boolean isDeposit() {
|
||||
return this == DEPOSIT;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user