Skip to Content

Creating persistence model

Hello, Experts

I'm rather new to HANA world so I wanted to ask you for a little hint/guidance.

I'm part of the development team that's working on an application written in Java that will consume HANA as a persistence model. (source of data for Java app). Java app will both write and read data from HANA tables, use stored procedures and views. Java app will be deployed on Hana cloud platform.

My task is to create data persistence model in HANA db (Hana cloud platform) and my question is which of the possible ways of data model creation is preferable on HANA.

We will have 2 instances of HANA db, one for development and one for production. Of course I will be using development system and I will need to transport my model to production system.

Should I create it using plain old SQL (directly into catalog) or should I create repository objects (.HDB syntax or CDS).

My guess is that I should be using this HANA native development (XS Project + CDS) but I am confused and I have limited time period for finishing this task.

Thanks in advance.

Sincerly,

Ivan

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

4 Answers

  • Best Answer
    Oct 11, 2016 at 08:29 AM

    Hello Ivan,

    of course that is possible also on HCP.

    Check https://help.hana.ondemand.com/help/frameset.htm?e4c52854bb571014aeb88753d0dad158.html for instance.

    Regards,

    Florian

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 10, 2016 at 08:26 PM

    Hello Ivan,

    if you wanna or must create the model directly on HANA, CDS is the preferred way. Directly creating it via SQL would force you to create it manually or by scripts on each target system. CDS artifacts can be transported (or deployed with XSA).

    But as you are using a Java Application you have to think about, if you can use JPA. There you define the model in the Java application (using JPA) and the application itself creates the model on the database. With that you only have to deploy the Java application, define the database binding and you don't have to think about the DB layer in deepth. Information regarding that can be found at following locations:

    Regards,

    Florian

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 11, 2016 at 08:27 AM

    Hello, Florian.

    Thanks for your help.

    Yes it makes sense to use JPA (judging by a first look on URL's You sent me), but i'm not that familiar with Java and the task for creating data persistence model was given to me. I'll have to read this documentation carefully and speak to my Java colleagues.

    I'm working as a HANA developer and I wanted to create it directly on HANA. Later, I'll need to create some stored procedures and HANA views (attribute, analytical and calculation).

    On our on premise system, I created XS Project with CDS document that creates data model and Java app could use my persistence model without a problem with help of JDBC driver. I even transported my delivery unit (containing package with CDS document) on other on premise system and activated my data model without a problem. After assigning a repository role to my user on that system i could have used it the same way I used it on my development on premise system.

    Is the same approach possible on HANA Cloud Platform or JPA is preferred and only possible way? I'm sorry if I repeat myself, but I have limited time period and I don't want to lose to much time doing the things in a wrong way.

    Thanks in advance.

    Sincerly,

    Ivan

    Add comment
    10|10000 characters needed characters exceeded

  • Oct 11, 2016 at 10:45 AM

    Many thanks, Florian.

    Then I'll stick to HANA and CDS and leave my colleagues deal with Java end.

    Best regards,

    Ivan

    Add comment
    10|10000 characters needed characters exceeded