Let us understand how One-to-one relationship is implemented in Hibernate using Annotations. For this we will use our previous article
One-to-one mapping in Hibernate using XML mapping and enhance it to support Annotations.Tools and Technologies used in this article:Java JDK 1.5 above MySQL 5 above Eclipse 3.2 above Hibernate 3 above Maven 3 above1. Database with One-to-one relationship tables We will use the same tables we created in our ...
Recently while working in one of the requirement, I had to convert String values to Enum. I didn't realize there is a simplest way of doing this. Here is the solution.Whenever an ENUM is complied in Java, two static methods are added by compiler called valueOf() and values(). We can use valueOf() method to convert any String value to ENUM. For example lets say we ...
Static Import is a new feature added in Java 5 specification. Java 5 has been around the corner for some time now, still lot of people who are new in Java world doesn't know about this feature.Although I have not used this feature in my work, still it is interesting to know about.What is ...
I think I am late for writing about varargs. The feature of variable argument has been added in Java 5 since its launch. Still I will write something about varargs. varargs has been implemented in many languages such as C, C++ etc. These functionality enables to write methods/functions which takes variable length of arguments. For example the ...