based2 / hibernate-generic-dao

Generic DAO implementation: extendable, detailed search, remote service interface from code.google.com/p/hibernate-generic-dao
4 stars 11 forks source link

Sub class a dao implementation #40

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
First, Great job, we use your generic dao in our project and it's very handy !

What steps will reproduce the problem?
1. create an implementation of GenericDAOImpl<ModelClass, IdClass> named
ParentDao 
2. extend ParentDao in ChildDao
3. new ChildDao();

What is the expected output? What do you see instead?
Constructor threw exception; nested exception is
java.lang.ClassCastException: java.lang.Class cannot be cast to
java.lang.reflect.ParameterizedType

What version of the product are you using? On what operating system?
Java 6 64 bits, ubuntu 8.10, but it's irrelevant.
Present in r590.

Please provide any additional information below.
It's a common issue with Generics. This blog entry shows a solution :
http://www.artima.com/weblogs/viewpost.jsp?thread=208860

Having the choice between an empty constructor (which would infer the
persistent class' type from the generic argument) and a contructor that
takes the persistent class as an argument would be a great solution if you
don't want to implement the whole solution :)

Thanks a lot !

Original issue reported on code.google.com by mathieu....@gmail.com on 30 Jul 2009 at 8:46

GoogleCodeExporter commented 9 years ago
Thanks for reporting and for the solution! I remember we had this problem back 
in the 
early stages but didn't get around to fixing it at the time.

I'll get this fix into the next release (0.5.1).

Original comment by dwolvert on 3 Aug 2009 at 12:19

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago

Original comment by dwolvert on 7 Aug 2009 at 12:15

GoogleCodeExporter commented 9 years ago
Fixed for 0.5.1

Original comment by dwolvert on 14 Nov 2009 at 3:39