• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

jpa problem

 
Ranch Hand
Posts: 104
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Address.java reworked

Person table is still empty?
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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..
 
That's my roommate. He's kinda weird, but he always pays his half of the rent. And he gave me this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic