You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
0
down vote
favorite
Im implementing hibernate ORM in my java project. Ive downloaded source from github Ive compiled hibernate-maven-web included in samples. Now lets assume i want to overload method in one of the implementations For example CitizenDAOImpl.java Before my changes it looked like that.
package sample.googlecode.genericdao.oldworld.dao;
import org.springframework.stereotype.Repository;
import sample.googlecode.genericdao.oldworld.model.Citizen;
/**
* <p>
* This is the implementation of the Citizen DAO. You can see that we don't
* actually have to implement anything, it is all inherited from GenericDAOImpl
* through BaseDAO. We just specify the entity type (Citizen) and its identifier
* type (Long).
*
* <p>
* The @Repository allows Spring to recognize this as a managed component (so we
* don't need to specify it in XML) and also tells spring to do DAO exception
* translation to the Spring exception hierarchy.
*
* @author dwolverton
*
*/
@Repository
public class CitizenDAOImpl extends BaseDAO<Citizen, Long> implements CitizenDAO {
}
All i did was override removeById that would just call super class. Later on im planing to add some ecrypt functionality so id will all be scrambled.
package sample.googlecode.genericdao.oldworld.dao;
import org.springframework.stereotype.Repository;
import sample.googlecode.genericdao.oldworld.model.Citizen;
/**
* <p>
* This is the implementation of the Citizen DAO. You can see that we don't
* actually have to implement anything, it is all inherited from GenericDAOImpl
* through BaseDAO. We just specify the entity type (Citizen) and its identifier
* type (Long).
*
* <p>
* The @Repository allows Spring to recognize this as a managed component (so we
* don't need to specify it in XML) and also tells spring to do DAO exception
* translation to the Spring exception hierarchy.
*
* @author dwolverton
*
*/
@Repository
public class CitizenDAOImpl extends BaseDAO<Citizen, Long> implements CitizenDAO {
@Override
public boolean removeById(Long id) {
return super.removeById(id);
}
}
when i run mvn clean install it gives me error
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.
1:compile (default-compile) on project hibernate-maven-web: Compilation failure
[ERROR] /C:/Dev/spike/hibernate-maven-web/src/main/java/sample/googlecode/generi
cdao/oldworld/dao/CitizenDAOImpl.java:[26,24] name clash: removeById(java.io.Ser
ializable) in sample.googlecode.genericdao.oldworld.dao.CitizenDAOImpl and remov
eById(ID) in com.googlecode.genericdao.dao.hibernate.GenericDAO have the same er
asure, yet neither overrides the other
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureExc
eption
I understand that its ambiguous call and both BaseDAO and CitizenDAO do inherit GenericADO at some point. What is good solution in this case? Thanks
The text was updated successfully, but these errors were encountered:
0
down vote
favorite
Im implementing hibernate ORM in my java project. Ive downloaded source from github Ive compiled hibernate-maven-web included in samples. Now lets assume i want to overload method in one of the implementations For example CitizenDAOImpl.java Before my changes it looked like that.
All i did was override removeById that would just call super class. Later on im planing to add some ecrypt functionality so id will all be scrambled.
when i run mvn clean install it gives me error
I understand that its ambiguous call and both BaseDAO and CitizenDAO do inherit GenericADO at some point. What is good solution in this case? Thanks
The text was updated successfully, but these errors were encountered: