I have an Employee class that holds...
private String firstName = "-";
private String middleName = "-";
private String lastName = "-";
I do not require that an Employee's middle name be provided so when I use...
SELECT firstName + " " + middleName + " " + lastName FROM Employee ORDER BY lastname, firstname, middleName
I may end up with the result list of...
Jane K Doe
John - Doe
Jacob B Smith
I'd prefer if I could have something similar to this in Query form...
ArrayList<String> list = new ArrayList<String>(); for(Employee emp : Employee.allEmployees()) if(emp.getMiddleName.equals("-")) list.add(emp.getFirstName() + " " + emp.getLastName()); else list.add(emp.getFullName()); alphabetizeList(list); //lastName, firstName, middleName
The results in list will be...
Jane K Doe
John - Doe
Jacob B Smith
Can this same result list be constructed purely using an ObjectDB Query?
Thank you,
Dragon