Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sub class a dao implementation #40

Closed
GoogleCodeExporter opened this issue Jul 29, 2015 · 4 comments
Closed

Sub class a dao implementation #40

GoogleCodeExporter opened this issue Jul 29, 2015 · 4 comments

Comments

@GoogleCodeExporter
Copy link

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
Copy link
Author

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

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

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

  • Added labels: Milestone-Release0.5.1, Priority-High
  • Removed labels: Priority-Medium

@GoogleCodeExporter
Copy link
Author

Fixed for 0.5.1

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

  • Changed state: Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant