help with java type erasure
-
05-07-2019 - |
Question
in my long journey to learn about hibernate, i wanted to use generic DAO and came across a good article at the hibernate site and tried out the IMPLEMENTATION WITH HIBERNATE Section.I'm having an error saying :GenericDAOImpl.java:[22,16] name clash: makeTransient(T) in GenericDAOImpl and makeTransient(T) in GenericDAO have the same erasure, yet neither overrides the other.I have no idea about how to solve that?Thanks for reading
Solution
Hard to say without seeing some of your code. For example, your implementing class should be defined as something like
public class GenericDAOImpl<T, ID> implements GenericDAO<T, ID>
and if you miss out the generic parameters in the GenericDAOImpl
class definition, you will get this error.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow