• 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

Difference between JoinColumn and mappedBy

 
Ranch Hand
Posts: 856
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although i know that, if there is uni directional relationship between two table's we use like this-

Car.java
-------------------------
@OneToOne
@JoinColumn(name="CarBillingId", referencedColumnName="car_billing_id", updatable=false)
protected CarBillingInfo carBillingInfo;
-------------------------

but if there is bidirectional relationship we use like this-

CarBillingInfo.java

----------------------
@OneToOne(mappedBy="carBillingInfo")
protected Car car;
-----------------------

but when i see the Apache Derby Database, the result's alook same(both car and carbillinginfo table's have same relationship in both ways). So what is the real difference between them which i can see.
 
He's dead Jim. Grab his tricorder. I'll get his wallet and this tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic