Home » Author Archives: Vlad Mihalcea (page 5)

Author Archives: Vlad Mihalcea

Vlad Mihalcea is a software architect passionate about software integration, high scalability and concurrency challenges.

A beginner’s guide to JPA/Hibernate entity state transitions

jboss-hibernate-logo

Introduction Hibernate shifts the developer mindset from SQL statements to entity state transitions. Once an entity is actively managed by Hibernate, all changes are going to be automatically propagated to the database. Manipulating domain model entities (along with their associations) is much easier than writing and maintaining SQL statements. Without an ORM tool, adding a new column requires modifying all ...

Read More »

Hibernate hidden gem: the pooled-lo optimizer

jboss-hibernate-logo

Introduction In this post we’ll uncover a sequence identifier generator combining identifier assignment efficiency and interoperability with other external systems (concurrently accessing the underlying database system). Traditionally there have been two sequence identifier strategies to choose from.         The sequence identifier, always hitting the database for every new value assignment. Even with database sequence preallocation we have ...

Read More »

From JPA to Hibernate’s legacy and enhanced identifier generators

jboss-hibernate-logo

JPA identifier generators JPA defines the following identifier strategies:                 Strategy Description AUTO The persistence provider picks the most appropriate identifier strategy supported by the underlying database IDENTITY Identifiers are assigned by a database IDENTITY column SEQUENCE The persistence provider uses a database sequence for generating identifiers TABLE The persistence provider uses a ...

Read More »

Hibernate Identity, Sequence and Table (Sequence) generator

java-interview-questions-answers

Introduction In my previous post I talked about different database identifier strategies. This post will compare the most common surrogate primary key strategies: IDENTITY SEQUENCE TABLE (SEQUENCE)     IDENTITY The IDENTITY type (included in the SQL:2003 standard) is supported by: SQL Server MySQL (AUTO_INCREMENT) DB2 HSQLDB The IDENTITY generator allows an integer/bigint column to be auto-incremented on demand. The ...

Read More »

Hibernate and UUID identifiers

java-interview-questions-answers

Introduction In my previous post I talked about UUID surrogate keys and the use cases when there are more appropriate than the more common auto-incrementing identifiers. A UUID database type There are several ways to represent a 128-bit UUID, and whenever in doubt I like to resort to Stack Exchange for an expert advice.     Because table identifiers are ...

Read More »

The hi/lo algorithm

software-development-2-logo

Introduction In my previous post I talked about various database identifier strategies, you need to be aware of when designing the database model. We concluded that database sequences are very convenient, because they are both flexible and efficient for most use cases. But even with cached sequences, the application requires a database round-trip for every new the sequence value. If ...

Read More »

Database primary key flavors

software-development-2-logo

Types of primary keys All database tables must have one primary key column. The primary key uniquely identifies a row within a table therefore it’s bound by the following constraints: UNIQUE NOT NULL IMMUTABLE When choosing a primary key we must take into consideration the following aspects:   the primary key may be used for joining other tables through a ...

Read More »

A beginner’s guide to Hibernate Types

jboss-hibernate-logo

The basic mapping concepts When learning Hibernate many like to jump to parent-child associations without mastering the object relation mapping basics. It’s very important to understand the basic mapping rules for individual Entities before starting modelling Entity associations. Hibernate types A Hibernate type is a bridge between an SQL type and a Java primitive/Object type.   These are the types ...

Read More »

The minimal configuration for testing Hibernate

jboss-hibernate-logo

Introduction In my previous post I announced my intention of creating a personal Hibernate course. The first thing to start with is a minimal testing configuration. The examples are relevant for Hibernate 4. You only need Hibernate In a real production environment you won’t use Hibernate alone, as you may integrate it in a JEE or Spring container. For testing ...

Read More »

The data knowledge stack

java-interview-questions-answers

Concurrency is not for the faint-hearted We all know concurrency programming is difficult to get it right. That’s why threading tasks are followed by extensive design and code reviewing sessions. You never assign concurrent issues to inexperienced developers. The problem space is carefully analysed, a design emerges and the solution is both documented and reviewed. That’s how threading related tasks ...

Read More »
Do you want to know how to develop your skillset and become a ...

Subscribe to our newsletter to start Rocking right now!

To get you started we give you our best selling eBooks for FREE!
Get ready to Rock!
To download the books, please verify your email address by following the instructions found on the email we just sent you.

THANK YOU!

Close