Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About the @CollectionTable in Chapter 5 overrideCollectionTableColumn

 
Himai Minh
Ranch Hand
Posts: 1361
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In chapter 5 of JPA Pro 2 (2nd edition),
first we create a table called Employee_Vacation :

CREATE TABLE Employee_VACATION (EMP_ID INTEGER NOT NULL, STARTDATE VARCHAR(255), DAYS_ABS INTEGER);


In the Employee.java provided, it has :




But when I ran it, it complains that table vacation does not exist.

I have to modify the Employee.java like this to make it work :




 
Paul Clapham
Sheriff
Posts: 21572
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Himai Minh wrote:In chapter 5 of JPA Pro 2 (2nd edition),
first we create a table called Employee_Vacation :

CREATE TABLE Employee_VACATION (EMP_ID INTEGER NOT NULL, STARTDATE VARCHAR(255), DAYS_ABS INTEGER);



Okay...

But when I ran it, it complains that table vacation does not exist.


Well, yeah, that's true. The table isn't named "vacation".
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic