imsavva.com

Folder icon

Tags / Java

Simple Hibernate + JPA tutorial

showPostImage(431772724)

Uncaught exception: the image was stolen by a UFO

In this small tutorial, we will see how to start using Hibernate framework. In further lessons, I will show how to create one-to-one, one-to-many, and many-to-many relationships. Now we are going to create a new Maven project, add some dependencies, configure JPA and create our first entity. Let's get started. By the…
Posted on
2017-02-08

How to create an ATG pipeline processor?

showPostImage(287503035)

Uncaught exception: the image is currently being shown in a museum

I'm currently studying Oracle ATG. Kinda big monstrous e-commerce platform. Today I had to create a commerce pipeline processor. So, I started googling and found this great tutorial by Oracle:  Creating processors . Well, that's not bad. But it's a bit poor. For example, I'd like to know, what is the  Object pParam…
Posted on
2016-06-21

Observer pattern

showPostImage(-716380058)

Uncaught exception: the image is currently being shown in a museum

Observer is a software design pattern, that is used when some objects create events and other objects should be notified when these events occur. The main idea is that we have two types of instances: one that produces events and one that consumes them. Events producer must have three methods: addObserver(Observer…
Posted on
2016-06-19

Strategy pattern

showPostImage(868043779)

Uncaught exception: the image is currently being shown in a museum

With this post I'm starting series of articles dedicated to GoF design patterns. GoF stands for Gang of Four - four authors that wrote a famous book about design patterns. So the first pattern I want to describe is Strategy . It allows to choose the behaviour of instances at runtime by defining appropriate strategy…
Posted on
2016-06-12

Programming competition and a small Java task

showPostImage(-933165126)

Uncaught exception: the image is currently being shown in a museum

Last week we had a programming competition at work which consisted of some small tasks. One of them was to check, if we can make a given string palindrome by adding one letter in any place. Shame on me, I didn't manage with this task on time. However I got the third place in this competition. 🏆😁 So the task: Your app…
Posted on
2016-04-27

Java task. Fibonacci sequence.

showPostImage(1086603326)

Uncaught exception: the image is currently being shown in a museum

Fibonacci numbers are a number sequence, where first two numbers are 1 and 1 or 0 and 1. Each subsequent number is the sum of previous two numbers. This task is often asked by interviewers (not only in Java). Let's solve it in two ways: using a loop and recursion. To see a recursive solution of this task, click "read…
Posted on
2016-03-21

What methods does Java Collection interface contain?

showPostImage(890699667)

Uncaught exception: the image was stolen by a UFO

int size(); boolean isEmpty(); boolean contains(Object o); Iterator iterator(); Object [ ] toArray(); T [ ] toArray(T [ ] a); boolean add(E e); boolean remove(Object o); boolean containsAll(Collection<?> c); boolean addAll(Collection<? extends E> c); boolean removeAll(Collection<?> c); boolean retainAll(Collection…
Posted on
2016-03-19