Paul Anilprem wrote:I tried to refrain from posting a reply on this topic but what the heck!
I'm glad you replied though :-)
I agree with you, Criteria is too different from anything else to simply get a grasp on if you're not used to it (that's why we're learning for this exam, right? :-p).
But what I love about it, is that it's way easier to mock and test than those pesky sql strings. How many times I've seen change be made in the database (for example change the name of a column), only to discover an sql query to fall over in production because there's just no way to test your queries. So I agree with you that it's hard to learn and read, but if all kinds of developers start to delete Criteria code in preference of sql or jpql, that's just bad, hire someone else (someone with a JPA Certificate :-))