• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

jpa problem

 
vik ar
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Address.java reworked

Person table is still empty?
 
Himanshu Chitranshi
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 104
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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..
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic