• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

@OneToMany primary key part of foreign key

 
Frank VanOor
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm a newbe and have a simple @OneToMany relationship to build without using a Join-Table and where the PK of table 1 is part of the PK in table 2

table 1: Exchange , PK: id
table 2: ExchangeRetrievalDate, PK: exchangeId (Pk of Exchange) + date



Hibernate throws the following exception:

Caused by: org.postgresql.util.PSQLException: ERROR: relation "public.exchange_exchangeretrievaldate" does not exist
 
Frank VanOor
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The reason was that the DB column names had mixed uppercase lowercase characters, and hibernate can't cope with that. I changed all column names to lowercase, and all works fine.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic