Hibernate vs MyBatis

15 May 2013 | | java, ORM, hibernate, myBatis

Comparison of MyBatis versus Hibernate

I’ve often heard people arguing about whether Hibernate is better or MyBatis. The truth is, “there is no spoon.” It is not about whether Hibernate is better or MyBatis, but which of these tools best fits your situation. Without further ado, here is a comparison.

Continue Reading →

Why ORM?

14 May 2013 | | java, ORM

Why use ORM?

The path to coding Nirvana is a long one. As you navigate these treacherous ways, you’ll find many corpses – of people who have died of SQL over-injection or of Object-Relational-Miscarriage. For those of you who’ve been doing object-relational stuff long enough and have scars in unmentionable places, go back to your drinks. For the rest of you, for whom ‘Why ORM?’ is an interview question, gather around and warm your toes by the electric light.

Continue Reading →

Sorting a map by values

14 Feb 2013 | | java, hibernate

How to sort a map in Java by its values instead of by its keys.

Most applications of Maps do not require ordering. Occasionally, we stumble upon instances where maps need sorting. To maintain insertion order in Maps, use a LinkedHashMap. To sort on the keys, use a SortedMap.

Continue Reading →

1 2 3 4 5 6