Custom Boolean User Type with Hibernate JPA

The ANSI SQL 1999 standard introduced a BOOLEAN data type (although unfortunately only as an optional feature). But to date it still isn’t implemented by most major database systems. As a consequence boolean columns are implemented in various ways. E.g., CHAR columns containing ‘Y’ or ‘N’, or using BIT columns. Subsequently, there is no way for JPA to provide a standardized way of mapping an entity’s boolean fields onto database columns.

Hibernate offers a custom YesNoType for boolean implementations using CHAR(1) columns containing ‘Y’ or ’N’ characters. But for other practices you basically have to provide your own solution. Fortunately, Hibernate offers the possibility of creating your own custom UserType’s. In this blog entry I will give an example of one such custom Boolean UserType. Continue reading “Custom Boolean User Type with Hibernate JPA”

InterSystems Caché database

The IT landscape at my work – the Academic Medical Center (AMC) in Amsterdam – is about to change dramatically in the next couple of years. We are migrating away from a best-of-breed strategy combined with alot of custom, and mostly inhouse, build software systems, towards the integrated suite of health care software from Epic. Epic’s suite is centered on the Caché database from InterSystems. So when I learned about a free one-day introductory course on Caché I didn’t hesitate to sign up.

So earlier today I attended the workshop at InterSystems Benelux together with a couple of colleagues from the AMC. The day was well organised and provided me with a nice overview and introduction on InterSystems and their products and the Caché database in particular.

I always assumed that the database was an object database but it appears I was mistaken. At its core is something called “globals”. These key-value datastructures are stored internally in multidimensional hierarchical sparse arrays. The globals find their origin in MUMPS, which takes the origin of Caché back to the late sixties! Caché provides SQL and Object API’s built on top of the “Globals”, so you can also use Caché just as if it were a RDBMS or object database, although in essence it’s really more of a NoSQL datastore.

Supposedly, the internals of Caché provide for extremely high performance data access and extremely high transaction data processing. So I’m really curious to find out if – once we’ll have rolled out the Epic system – this claim holds true, and how it compares to the relational databases from the traditional competitors like Oracle and Microsoft.