Is this String concatenation creating extra String?
Enter the mad world of optimization!

The Java compiler and HotSpot just-in-time compiler are programmed with a great many rules for optimizing performance of Java code.

In general, it is NOT worth your time to fret about the performance impact of these kinds of details as they are often taken care of. Rather, just try to write clean readable code that solves the problem. If performance is an issue, profile the code and then optimize the bottlenecks.

Now, to address this specific issue, I am virtually certain that constant expressions are resolved by the Java compiler at compile time. I would be very surprised if the byte code for your two queries wasn't identical.