• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Difference between JoinColumn and mappedBy

 
Ranch Hand
Posts: 856
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
What's gotten into you? Could it be this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic