Peter Ja wrote:You can check whether Spring is building the count query by looking at the result type of the query:
Tim Cooke wrote:
Martin Bechtle wrote:Is it possible to keep the XML outside the war/jar package? In that case it would really make sense.
You can do that yes, but I'd not be entirely comfortable with that. Spring xml configs are heavy on implementation detail quoting class names with full package prefixes which aren't super friendly to application support and configuration maintenance people. Plenty to get wrong, and get wrong big.
In our application we use Spring xml configuration for everything but our MCV controller classes for which we use annotations. We also use Spring Profiles to selectively enable and disable certain bean wiring configurations in our xml. For example:
Now the configuration switch item is outside of the Spring xml file.
Tim Cooke wrote:
Martin Bechtle wrote:Am I missing something that you find really useful with XML config?
Let's say my application supports MySQL and Oracle databases. I have written DAO's for both and I'm using Spring to inject the Oracle DAO into some other service class.
Let's say my customer now decides that they've had it with paying Oracle oodles of cash in licencing and they want to switch to MySQL. No problem, I can reconfigure my application without having to produce and version a new build. Just a Spring xml config change and a server reboot. Job done.
That's one example, of course there are others.