cancel
Showing results for 
Search instead for 
Did you mean: 

Problems when using JPA for Oracle database

Former Member
0 Kudos

Hi experts,

I have a scenario that need your help

I want to migrate the code using Hibernate to the JPA of SAP, and I try to connect to the Oracle database by the JPA of SAP

But, it seems to be that the JPA of SAP is case sensitive to Oracle database. This doesn't happen to the Hibernate.

Therefore, my solution is that I include quotation mark ("") in each table name and column name of the dbscript like below

+ Dbscripts:

CREATE TABLE "GroupInfo"

(

"ID" VARCHAR2(50) NOT NULL,

"Name" VARCHAR2(50) NOT NULL,

"PreferenceInfo" blob,

"BlackListInfo" blob,

"PwdPolicyInfo" blob,

"PredefineAppInfo" blob,

"Description" VARCHAR2(255),

"CreatedDate" VARCHAR2(25),

"DomainID" VARCHAR2(255) NOT NULL references "DomainInfo"("ID") on delete cascade,

"ParentID" VARCHAR2(50),

"CanonicalName" VARCHAR2(255),

"DN" VARCHAR2(1000),

"GroupType" NUMBER(1,0),

"AuthID" VARCHAR2(255),

"LastSyncDate" VARCHAR2(25),

CONSTRAINT "PK_GroupInfo" PRIMARY KEY ("ID")

);

+ Persistable GroupInfo entity

@javax.persistence.Entity

@Table(name="GroupInfo")

public class GroupInfo implements Entity {

@Id

@Column(name="ID")

private String id;

@Column(name="Name", length=50, nullable=false)

private String name;

...

}

>>>

But the dbscript above doesn't work with Hibernate because Hibernate can not recognize table name including quotation marks such as "GroupInfo"

What can i do to make dbscript work both of Hibernate and the JPA of SAP?

Is it right to include quotation marks to each table name and column name when working with the JPA of SAP?

Are there other solutions for that?

Accepted Solutions (0)

Answers (1)

Answers (1)

adrian_goerler
Active Participant
0 Kudos

Hi,

I'd like to suggest that you you use upper case letters in tables and column names only. In this case you should not need to use delimited identifiers in the DDL scripts. It should work with SAP JPA and Hibernate.

-Adrian

Former Member
0 Kudos

Thank you for your response, I will change dbscript by using uppercase for name like this

CREATE TABLE "GROUPINFO"

(

"ID" VARCHAR2(50) NOT NULL,

"NAME" VARCHAR2(50) NOT NULL,

"PREFERENCEINFO" blob,

"BLACKLISTINFO" blob,

"PWDPOLICYINFO" blob,

"PREDEFINEAPPINFO" blob,

"DESCRIPTION" VARCHAR2(255),

"CREATEDDATE" VARCHAR2(25),

"DOMAINID" VARCHAR2(255) NOT NULL references "DOMAININFO"("ID") on delete cascade,

"PARENTID" VARCHAR2(50),

"CANONICALNAME" VARCHAR2(255),

"DN" VARCHAR2(1000),

"GROUPTYPE" NUMBER(1,0),

"AUTHID" VARCHAR2(255),

"LASTSYNCDATE" VARCHAR2(25),

CONSTRAINT "PK_GROUPINFO" PRIMARY KEY ("ID")

);

Thanks

Regards,

Dat

Edited by: Dat Triet Banh on Jul 4, 2011 4:49 AM