You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@openjpa.apache.org by cppexpert <op...@walkmind.com> on 2008/11/18 10:47:44 UTC
Foreign key field doesn't get populated in descendant class in Join
Inheritance
Hi guys.
I have a question about join table inheritance. In few words the problem is
that foreign key field doesn't get set in descendant class in Join
Inheritance.
I have 3 tables: authors, books and electronic_books.
Here is SQL script: http://pastebin.ca/1259927
AuthorsEntity: http://pastebin.ca/1259929
BooksEntity: http://pastebin.ca/1259931
ElectronicBooksEntity: http://pastebin.ca/1259932
In my test case I have one author who has 3 books - 2 regular books and one
electronic.
When I fetch that single instance of AuthorsEntity I see that for some
reason field BooksEntity.author of instance of an object
ElectronicBooksEntity equals null. But remaining 2 instances of base class
BooksEntity have properly set 'author'. Initially I thought ALL fields of
base class won't be set but it turns out ElectronicBooksEntity.id and
ElectronicBooksEntity.title have valid values.
Am I missing something in definition of my descendant class ?
Thanks!!
--
View this message in context: http://n2.nabble.com/Foreign-key-field-doesn%27t-get-populated-in-descendant-class-in-Join-Inheritance-tp1513659p1513659.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.