Java
-
Java Persistence API (JPA) ~ Part 2 ~ Entity Manager
The entity manager API is used to create and remove entity instances, find entities by their primary key and to query entities. JPA defines a persistence unit in the persistence.xml file which caters…
-
Java Persistence API (JPA) ~ Part 1 ~ The basics
What is persistence? Applications are designed to store and manipulate data in a remote datasource/database so that it can be retrieved, processed, transformed or analyzed at a later time. Persistence refers to the…
-
Managing collections of data in Java
The Java Collections Framework supports multiple approaches to creating and managing collections of data. Collections of data can be ordered or unordered. There are various interfaces that are exposed by the Java Collections…
-
Static vs. non-static methods
If you want to use a method without creating an instance of that class, static methods are the way to go. If your method is related to an instance’s attributes, it should be…
-
Inversion of control in Spring
In Inversion of Control (IOC), the container itself maintains the class dependencies and manages the lifecycle of those dependencies. Objects are injected as dependencies when required at runtime or at application startup as…
-
Spring Data JPA
Spring Data JPA provides a common set of interfaces based on Java Persistence API (JPA) leveraging method naming conventions to derive data access behaviour using JPA and Hibernate which provides aspected behaviour. Practically,…
-
Java Objects & Classes
An object contains data and the behaviors of a single concept. The way we represent objects and how we use them are defined in classes therefore objects are an instance of a class…
-
Java Primitive Variables
Java classifies data with data types based on its value. Because Java is a static language, all variables have types that are set when the variable is declared and once set, the variable’s…