Skip to Content
0

Support for JPA generation type SEQUENCE

May 31, 2017 at 03:17 PM

97

avatar image

Does SAP Cloud Platform have any plan to support JPA id generation using a HANA database sequence? At the moment, we're using the default TABLE generation type however that can cause locking issues.

With thanks,

Scott

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Richard Zhao
Nov 24, 2017 at 09:06 AM
0

Hello, Scott. If you can use the database sequence to generate pk of a table. Usually, we generate-id on service layer of application by using UUID or Custom ID generator Class. I suggest that using UUID+tableCode (new column of your table) together. It will bring more benefits when doing data migration. thanks.

package com.mytest;
import java.util.UUID;
public class UTest {    
          public static void main(String[] args) {        
                UUID uuid = UUID.randomUUID();        
                System.out.println(uuid);    
          }
}
Share
10 |10000 characters needed characters left characters exceeded