Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

jpa problem

 
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?
 
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..
 
I've read about this kind of thing at the checkout counter. That's where I met this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic