• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mapping nullable FKs

 
Pedro Lobato Sena
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Guys,

I have two situations, both of them with the same point: nullable FK

I have a entity called MasterCity that has a reference to another entity called MasterLanguage.

But some cities has null values for that column. I would like that my object language be null, but instead, I'm getting an exception when I make the search.



I tried the optional attribute in @OneToOne, I also tried nullable = true in @JoinColumn, neither of them worked fine.

I would appreciate some help.

Thanks in advance,

Pedro Sena
 
Pedro Lobato Sena
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I was testing it in JSE environment.

I forgot to include some hibernate libraries, that was the problem.

Thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic