GeeCON Prague 2014*
The moose likes Object Relational Mapping and the fly likes jpa problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "jpa problem" Watch "jpa problem" New topic
Author

jpa problem

vik ar
Ranch Hand

Joined: Jul 31, 2009
Posts: 104
Hi. I am getting the following error

I have made sure in debug mode the following persist code is functioning as required.

My entity classes are as follows:

Person.java

Address.java

vik ar
Ranch Hand

Joined: Jul 31, 2009
Posts: 104
I have reworked my code as follows:

persistence class

Address.java

Person.java

I am getting the error

My datasource is connecting to oracle as the system administrator and the tables Person and Address are in the schema rbv. I am wondering if this is the issue?
vik ar
Ranch Hand

Joined: Jul 31, 2009
Posts: 104
right in the classes I prefixed the table names with 'rbv.' My address table is being populated but the person table is empty. Do I need to save the person objects seperately??? I thought they would be persisted by simply persisting my address object???
vik ar
Ranch Hand

Joined: Jul 31, 2009
Posts: 104
Address.java reworked

Person table is still empty?
Himanshu Chitranshi
Greenhorn

Joined: Sep 06, 2008
Posts: 6
i think the user id and password which you are using in obtaining the connection with database do not have sufficient permission.

Use the same user and password and login to oracle and fire any update or insert query..check whether you are getting the same ORA error message....
vik ar
Ranch Hand

Joined: Jul 31, 2009
Posts: 104
I am not getting an ORA error message at the point of persist. If it is a permission problem how come the address table is being populated fine? Unless there is some special permission required for the cascade which I dont know about. My sql is as follows

After reworking my sql as above and changing my datasource to connect as the rbv user I no longer need to prefix the table names in the classes with rbv. However the cascade still doesnt work?
Himanshu Chitranshi
Greenhorn

Joined: Sep 06, 2008
Posts: 6
Hello,

In the @Table annotation can you please use the schema attribute explicitly..

I mean in person use

@Table(name="PERSON",schema="rbv")

In Address use

@Table(name="ADDRESS",schema="rbv")

Default value of schema is "" so may be it is creating the problem..
 
GeeCON Prague 2014
 
subject: jpa problem