• Post Reply Bookmark Topic Watch Topic
  • New Topic

About the @CollectionTable in Chapter 5 overrideCollectionTableColumn  RSS feed

 
Himai Minh
Ranch Hand
Posts: 1514
9
  • 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: 22204
38
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".
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!