I'm a big fan of formatting code so that is as readable as possible. When it comes to TopLink Expressions, there is definitely a way to format them so that they are virtually unreadable, and a way to format them to be readable.
Only problem is, I haven't figured the best way to format them to be as readable as possible. How do some of you format your TopLink Expressions?
Here's an example of an unreadable expression:
ExpressionBuilder expBldr1 = new ExpressionBuilder();
Expression exp1 = builder.get("company").get("address").get("state").equal("NY");
Expression exp2 = builder.get("company").get("address").get("city").equal("New York");
Expression exp3 = exp1.or(exp2);
Expression exp4 = builder.get("employee").get("hireDate").greaterThan(someDate);
Expression exp5 = exp3.and(exp4);
{code}To me, this is pretty hard to read, even for this relatively simple example. It gets a lot worse with more complex expressions. What would you do to make this more readable?