News

How to use typesafe enums in switch statements. A simple typesafe enum declaration in Java code looks like its counterparts in the C, C++, and C# languages: enum Direction { NORTH, WEST, EAST, SOUTH } ...
JPA and Hibernate enum mapping. The Java enum, introduced in Java 5, will map to the underlying database without any intervention. The JPA framework, be it Hibernate or Toplink or DataNucleus, will ...
Ashutosh‘s post Comparing Java Enums concludes that “using == over .equals() is more advantageous in two ways” (avoiding the NPE and getting the static compile-time check).