ztx1491 / hibernate-generic-dao

Automatically exported from code.google.com/p/hibernate-generic-dao
1 stars 0 forks source link

NullPointerException thrown when trying the "table per concrete class using implicit polymorphism" approach #65

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?

1. Create an abstract class with no persistence mappings.
2. Create 2 classes that extends the abstract class and create persistence 
mappings for them.
3. Create a search object that searches for the abstract class. Add at least 1 
filter (so there is a where clause created).
4. Execute the search.

What is the expected output? What do you see instead?

Results from the 2 concrete classes should be returned. Instead, a 
NullPointerException is thrown. It looks like the code assumes that the 
abstract class will always be mapped, but Hibernate does not require this: 
http://docs.jboss.org/hibernate/stable/core/reference/en/html/inheritance.html#i
nheritance-tableperconcreate-polymorphism

I'm sorry I don't have the exact error in front of me, as I ran into this last 
week. I've since changed the mappings to use union-subclasses (which works 
great), but I wanted to let you know about the behavior I witnessed.

What version of the product are you using? On what operating system?
Version 0.5.1. Windows XP.

Original issue reported on code.google.com by cmal...@gmail.com on 19 Jul 2010 at 6:33