Skip to Content

Prepare to build a translytical application with Hibernate

Set up the code, the Google Cloud Platform project, and the data for building translytical applications with Hibernate on SAP HANA.
You will learn
  • How to set up the Google Cloud Platform project
  • Where to get the application code
  • How to prepare the required external data
breglerjJonathan BreglerJanuary 12, 2021
Created by
August 28, 2018


You’ll need the following software installed before setting up the project:

  • Step 1

    The application code is available on GitHub.

    Clone it to your local machine using a Git client and switch to the branch tutorial.

    git clone --branch tutorial
  • Step 2

    You can import the project as a Maven project into Eclipse.

    Open the Eclipse IDE.

    Import the project by selecting File > Import…, then choosing Maven > Existing Maven Projects.

    Import Maven project

    Browse to the location into which you cloned the code and afterwards click on the Finish button.

    Select Maven project location

    You should now see the project in the Eclipse project explorer.

    Eclipse project explorer
  • Step 3

    In the Google Cloud Platform Console, browse to APIs & Services > Library.

    API library

    Search for Maps JavaScript API.

    API library search

    Click on the tile labeled Maps JavaScript API, and click on Enable.

    Google Maps Javascript API

    To be able to use the Maps JavaScript API, you also need to create an API key. Navigate to APIs & Services > Credentials*.

    API credentials

    Click on Create credentials > API key to create a new API key.

    Create new API key

    You’ll see a popup window displaying the API key. It is strongly recommended to restrict the API key to your applications to prevent unauthorized use. To restrict the key, click Restrict key.

    Restrict the API key

    You can choose any restriction type that fits your use case.

    For example, to restrict the key to certain domains you can choose the restriction type HTTP referrers (web sites) and enter the URLs of the sites that are allowed to use the API key. Good choices are http://localhost:8080/* for local testing and https://<your project ID>* for running the application on the Google App Engine (make sure to replace <your project ID> with your actual Google Cloud project ID).

    When you’re finished entering the referrers, click Save.

    Restrict the API key
  • Step 4

    If you haven’t done so yet, you need to set up the Google App Engine for you project. To do this, navigate to App Engine > Dashboard in the Google Cloud Platform Console.

    App Engine dashboard

    In the tile labeled Your first app, click Select a language and choose Java.

    App Engine setup

    Choose the same region that you already chose for your SAP HANA, express edition instance to minimize the latency between the App Engine and the Compute Engine.

    Then click Next and wait for the setup to complete.

    App Engine location
  • Step 5

    Download the CSV version of the San Francisco Police Department Incidents data set and the CSV version of the San Francisco Addresses data set and place them into the src/main/resources/csv directory as incidents.csv and addresses.csv, respectively.

    Create two ZIP archives named and, respectively, each containing the corresponding CSV file and make sure to have the zip tool split the archives into parts no larger than 30 megabytes. Otherwise the resulting files can’t be uploaded to the Google App Engine.

    Once the ZIP files have been created, delete the two CSV files.

    Your src/main/resources/csv directory should now contain 6 files.

    |- incidents.z01
    |- incidents.z02
    |- incidents.z03
  • Step 6

    Open the file pom.xml in the project’s root directory and update the build properties to match your settings.


    You’ll have to update the properties, and jdbc.port to match the actual connection data of your database instance.

    Note: Check out step 1 of the tutorial Create a User, Tables and Import Data Using SAP HANA HDBSQL for information about which values to use for the database host (, and the database port (jdbc.port).

    You’ll also have to update the properties jdbc.username and jdbc.password with valid user credentials.

    Note: The default schema of the database user specified in the jdbc.username property must be empty.

    Lastly, you’ll have to update the properties to match your Google Cloud Platform project ID and google.api.key to match the API key created earlier.

    After the adjustment the properties should look something like this:


    Save the pom.xml file.

  • Step 7

    Open the file in the directory src/main/resources.

    Update the properties csv.incidents.file.location and csv.addresses.file.location to point to the ZIP archives created earlier.


    Save the file.

  • Step 8

    Now the application is ready to be deployed to the Google App Engine. To do this, you can use the Google App Engine Maven plugin.

    In a console, run the following command from the root directory of the project.

    mvn clean appengine:deploy

    The application will be deployed to the Google App Engine.

    The initial deployment will take some time because the data files need to be uploaded and the data needs to be loaded into the database.

    After the deployment has succeeded you can navigate to https://<your project ID> If the deployment was successful, you should see the web UI.

    Web UI

    Select the correct file which contains the application configuration:

Back to top