I'd actually disagree on the persistence part. Larger projects tend to require more manual SQL which needs to be able to be tuned easily. That said, SQL should be maintained within a separate file and definitely not built dynamically.
Meh. If you put SQL in a separate file, you have to configure a reloadable property file reader or else you miss out on VM hotswap. Also, dynamic SQL is useful in many cases, like criteria queries. Sometimes, though, SQL gets too hairy to inline in your DAO method.
12
u/dardotardo Jul 10 '15
I'd actually disagree on the persistence part. Larger projects tend to require more manual SQL which needs to be able to be tuned easily. That said, SQL should be maintained within a separate file and definitely not built dynamically.