cancel
Showing results for 
Search instead for 
Did you mean: 

JPA Problem: while using Oracle BINARY_FLOAT Data type

Former Member
0 Kudos

Hi,

We have generated entities from the existing tables using the data base connection. The entities are generated fine. But after that i am getting the below error.

Error:

The persistent attribute 'tktValLocal' in class 'com.stt.entity.TbSttTicketData' tagged as 'basic' exists, but is not persistent according to the JPA specification.

We are using JPA 1.0. I could find this particular attribute is created as "Object" data type in the generated entity class.But in database it is defined as a "BINARY_FLOAT". I googled with the data type and found that BINARY_FLOAT is compatible with java.lang.Float.

After change it , am getting the below error while run time.

Caused by: java.lang.RuntimeException: The persistence unit is inconsistent with the database schema:

Error on entity >>com.stt.entity.TbSttTicketData<<: The table >>TB_STT_TICKET_DATA<< does not exist.

Please advice me to solve this problem.

BR

Karthika

Edited by: SAKarthika on Apr 6, 2011 11:06 AM

Accepted Solutions (1)

Accepted Solutions (1)

adrian_goerler
Active Participant
0 Kudos

Hi,

you have used the generate entities from database tables feature, which has not recognized the Oracle-specific type BINARY_FLOAT. It could not map this type to float but generated a field with type Object in to the entity. Object, however, is not a persistent data type recognized by JPA. You have to edit the generated entiy manually. This is what you did.

Now, you are observing the error:

Caused by: java.lang.RuntimeException: The persistence unit is inconsistent with the database schema:

Error on entity >>com.stt.entity.TbSttTicketData<<: The table >>TB_STT_TICKET_DATA<< does not exist.

This error is not related to the issue you were observing before. Instead, I assume that either

- your application is not associated with a data source referring to the schema you generated the entities from or

- your data source is configured for Open SQL. In this case you can't see the native Oracle schema. Please configure your data source for Native SQL.

I hope this helps,

Adrian

Former Member
0 Kudos

Hi Adrian,

You are absoultely correct. Now it is working fine.

Thank a lot for your help

BR

Karthika

Answers (0)