Using the eclipse formatting on a class with some @NamedQueries
created concatenations.
While I have been doing this for years without paying attention I just realised that may be it is not a good usage.
So basically Which one of these String
s inside the query
is better ? Is the second one creating too many String
s? Should I be bothered at all?
My answer would be yes second one is creating extra Strings but I am not sure I should be concerned.
First Query
@NamedQuery(
name = SomeConstant,
query="SELECT person FROM Person person Where person.name = :name ")
Second Query
@NamedQuery(
name = SomeConstant,
query="SELECT person FROM Person person"+" "+
"Where person.name = :name ")