While SQL & Hibernate are mostly portable, one crucial area remains subject to incompatibility. Primary keying is the foundation of our tables, but key allocation is non-standard.
Most other SQL elements are standard & compatible, especially with the help of Hibernate. Joins, columns, mappings & queries will generally port without a hitch.
But when we get to identifier generation, the picture falls apart. Some databases use auto-increment/ identity columns, others sequences. Syntaxes differ, retrieving generated keys is variable at best. With such divergence, how can we possibly allocate keys portably? Continue reading →
In a recent role, I introduced Hibernate into an existing multi-tenant application. This required integrating Hibernate with an existing (custom) multi-tenant structure.
Hibernate – as standard – knows nothing about tenancies. So how can we accomplish such a task? Continue reading →
Recently, a poster on StackOverflow asked how to design the “perfect” JPA entity.
He had been working with Hibernate for some time, but still found himself struggling with questions as property type & accessibility, immutable properties, and equals/hashCode implementation.
So here are some answers.
Continue reading →
Insights into Java coding, OO design & architecture