YURI MARX GOMES · Feb 2, 2021 4m read

Example: Using Java + SpringBoot + Hibernate and IRIS Database to create REST API

Spring Boot is the most used Java framework to create REST API and microservices. It can be used to deploy web or executable web or desktop self-contained apps, where the application and another dependencies are packaged toghether. Springboot allows you do to a lot of functions, see:

Note: to learn about SpringBoot see official site -

To create an web api application, with one or more microservices can you use Spring IDE for Eclipse or VSCode and use a wizard to config the technologies above that will be used into your app, see:

You select the technologies and create the project. All technologies will be imported using maven. This is like a visual zpm.

The project created has a class to up the application with all you need inside it (web and application server, and all dependencies, microservice concept).

The complete source code to this project is in the the open exchange project:

The first thing to do is config IRIS JDBC Driver and IRIS Hibernate support, to do this, copy the jar files to the resources folder, see:

Open the pom.xml to configure the dependencies to these jar files, see:



Now you can config your connection with IRIS database into, see:

spring.datasource.driver-class-name=com.intersystems.jdbc.IRISDriver = false

Next step in create a Persistent Java Class mapping to a IRIS table, see:


import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.fasterxml.jackson.annotation.JsonFormat;

@Table(name = "Product")
public class Product implements Serializable {

    private static final long serialVersionUID = 1L;

    @GeneratedValue (strategy = GenerationType.IDENTITY)
    private Long id;
    private String name;
    private String description;
    private Double height;
    private Double width;
    private Double weight;
    @JsonFormat(pattern = "dd/MM/yyyy")
    private Date releaseDate;

    public Long getId() {
        return id;

    public void setId(Long id) { = id;

    public String getName() {
        return name;

    public void setName(String name) { = name;

    public String getDescription() {
        return description;

    public void setDescription(String description) {
        this.description = description;

    public Double getHeight() {
        return height;

    public void setHeight(Double height) {
        this.height = height;

    public Double getWidth() {
        return width;

    public void setWidth(Double width) {
        this.width = width;

    public Double getWeight() {
        return weight;

    public void setWeight(Double weight) {
        this.weight = weight;

    public Date getReleaseDate() {
        return releaseDate;

    public void setReleaseDate(Date releaseDate) {
        this.releaseDate = releaseDate;


Last step is create a Repository interface to expose your persistent class as a REST service (in the HATEOAS pattern), with crud operations, you don't need write this only:




public interface ProductRepository extends JpaRepository<Product, Long> {


Now, you run your app as a Spring Boot app:

Wait to the internal server up and open localhost:8080. Spring boot will open a API REST HAL Browser to you. See this image record:

IRIS with Hibernate in action

See more details in my app sample. I package all together in a Docker project with 2 services: IRIS and SpringBoot.

The HATEOAS pattern is very nice pattern to the api urls, path and navigation, see more details in:


2 0 2 102
Log in or sign up to continue


No disrespect to what you've created, but I have to say I'm always amazed and dismayed at how complex the Java community always seem to manage to make even the simplest of tasks - Spring/Hibernate is a classic example of making a crazy mountain out of what should technically be a very simple mole-hill.

By comparison, take a look at mgweb-server:  and its underlying mg_web interface ( for probably the thinnest (and therefore the most performant) and simplest way possible of delivering REST services using IRIS.  

For me InterSystems IRIS is the best Data Platform in the Market, with zpm and new additions like integratedml, is more strong. The Java community and Java corporate applications are leaders in the marketshare, but many times they are using Oracle, SQL Server, PostgreSQL and MySQL because they don't know about IRIS. This article is my little contribution to brake this situation. Now, when the Java community looks for a concrete sample how to use Java with IRIS, they can download a complete sample, with docker + spring + hibernate and our fantastic data platform. I hope many java developers discover IRIS and the IRIS get more popular. I wrote this sample because a great company in Brazil is migrating from postgresql to IRIS, because they want to go futher, with operational and analytics dimensions toghether in their projects. The other databases are operational only, IRIS is multipurpose and multimodel.