• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Not Understanding Inheritance plus Set of Own Types

 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, that subject probably doesn't make any sense. I've taken over the code base for a project and I've got the following scenario:







When the app kicks off and hibernate is trying to create the schema I get the following exception:



I honestly don't understand this inheritance stuff a whole lot but more importantly at the moment why the mapping isn't working correctly.

[ October 10, 2008: Message edited by: Gregg Bolinger ]
[ October 10, 2008: Message edited by: Gregg Bolinger ]
 
Edvins Reisons
Ranch Hand
Posts: 364
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is the childProjects field defined? Its definition should contain a Set implementation.
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Edvins Reisons:
How is the childProjects field defined? Its definition should contain a Set implementation.


 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I've "solved" the problem though I am not sure if what I've done might create a different problem later on. I moved the annotation from the method level and placed it on the field level. This allowed JPA to know what implementation of Set I was using.

I've read on the differences between method level and field level markup but I'm still not 100% clear on one vs the other. By moving this annotation to the field, am I losing or gaining anything important that I need to be aware of?
[ October 13, 2008: Message edited by: Gregg Bolinger ]
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Seems there is a bit more to the story. I just learned that you can't mix and match field level and method level annotations. It has to be one or the other 100%. :roll:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic