Tag: Eclipse
-
Audit Framework with Spring AOP and JPA
Every now and then we come across a common requirement of building an Audit framework. In simple words it means whenever a record is added, edited or removed there should be an entry made in a separate table so that different actions of users can be monitored. Today in this tutorial we will build an…
-
Spring AOP using Annotation
AOP a.k.a Aspect Oriented programming using Spring is a common usage now. In a nutshell it provides common functionality to be weaved into beans. Functionalities like logging before and after method is executed instead of being part of actual method implementation can be wired. Some important notes about AOP with Spring: Spring AOP is implemented…
-
JPA OneToMany Mapping Using Hibernate and MySQL
OneToMany as name suggest is the scenario where one entity can be linked to multiple entities. For e.g. one BookShelf can contain multiple books. In this tutorial we will use the same problem statement and model it using JPA with Hibernate as the JPA implementation provider. First we will write our simple BookShelf entity, BookShelf…
-
JPA One to One Bi Directional Mapping using MySQL and Hibernate
In the last post we saw how to define OnetoOne mapping using JPA but it was unidirectional, which means when we load Employee we can see EmployeeAddress but vise-versa is not true. Today we will update our mapping so that if we fetch EmployeeAddress we can obtain related Employee. Our Employee.java will remain as it…
-
JPA Unidirectional One to One Mapping using MySQL
In this tutorial we will explore how to map two entities. Say we have two entity Employee and Address, every employee will have one associated address, association will look like: JPA supports multiple types of mapping, in this tutorial we will see how to do “Uni-Directional” One to One Mapping. First we will setup our…
-
Create Java Project using Maven in Eclipse
When I started with Maven, I couldn’t understand a thing, Using Maven creating an eclipse project was the most difficult thing for me. Today we will explore how quickly we can create a project using maven in eclipse. What we need: JDK Maven Eclipse Plugin Maven Eclipse Indigo I am using Eclipse Indigo but steps…