use of com.servoy.j2db.persistence.SortingNullprecedence in project servoy-client by Servoy.
the class FoundSetManager method getSortOptions.
@Override
public SortOptions getSortOptions(IColumn column) {
boolean ignoreCase = false;
SortingNullprecedence sortingNullprecedence = SortingNullprecedence.databaseDefault;
if (column != null) {
try {
// First defined at server level
IServer server = application.getSolution().getServer(column.getTable().getServerName());
if (server != null) {
ignoreCase = server.getSettings().isSortIgnorecase();
sortingNullprecedence = server.getSettings().getSortingNullprecedence();
}
} catch (RepositoryException | RemoteException e) {
Debug.error("Exception getting server settings", e);
}
ColumnInfo columnInfo = column.getColumnInfo();
if (columnInfo != null) {
// Can be overridden at column level
if (columnInfo.getSortIgnorecase() != null) {
ignoreCase = columnInfo.getSortIgnorecase().booleanValue();
}
if (columnInfo.getSortingNullprecedence() != null && columnInfo.getSortingNullprecedence() != SortingNullprecedence.databaseDefault) {
sortingNullprecedence = columnInfo.getSortingNullprecedence();
}
}
}
return SortOptions.NONE.withIgnoreCase(ignoreCase).withNullprecedence(sortingNullprecedence);
}
Aggregations