• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

About the @CollectionTable in Chapter 5 overrideCollectionTableColumn

 
Ranch Hand
Posts: 1749
12
  • 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 :




 
Sheriff
Posts: 24635
56
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".
 
Do not threaten THIS beaver! Not even with this tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!