• 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

@JoinColumn annotation's name

 
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

This could be me misunderstanding something, or could be one for the book errata...

I'm reading EJB In Action, pg 274-275.
"The @JoinColumn annotation's name refers to the name of the foreign key in the Users table".
In listing 8.7, it is "USER_BILLING_ID" but in Figure 8.4 it is "BILLING_ID".

Is this a simple mistake (doesn't appear on the errata I printed out in Feb), or is the "User" prefixed because that's the class name?

Thanks in advance,

MG
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As described on pg - 275, If omitted, the "name" property takes the form -

<relationship field/property name>_<name of the referenced primary key column>

I think there is a print mistake on pg -274 when it says "The USERS table contains a foreign key named USERS_BILLING_ID that refers to BILLING_INFO tabel's BILLING_ID primary key".
USER_BILLING_ID should be read as just BILLING_ID (actual name of the column in USERS table)

And I wonder if the name="USER_BILLING_ID" should have been replaced by name="BILLINGINFO_BILLING_ID". Is it a print mistake again?

Could someone please confirm?
 
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://www.manning.com/panda/excerpt_errata.html
 
Amol Katyare
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Deepika. But it is not listed in book errata
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Probably related to the errata I have posted here.
 
Mark Garland
Ranch Hand
Posts: 226
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

Thank you Christophe - I hadn't spotted your errata - and that's a very useful link.

MG
 
I just had the craziest dream. This tiny ad was in it.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic