Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

About the @CollectionTable in Chapter 5 overrideCollectionTableColumn

 
Himai Minh
Ranch Hand
Posts: 1396
8
  • 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: 21941
36
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".
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!