The method:
public Mainsubjects getChosenMain(String loc, int id) {
List list = hibernateTemplate.find("from Mainsubjects where locale = ? and id = ?", loc, id);
Mainsubjects main = (Mainsubjects) list.get(0);
return main;
}
gives me:
getChosenMain(java.lang.String,int) in fi.utu.tuha.db.DatabaseOperations cannot implement getChosenMain(java.lang.String,int) in fi.utu.tuha.db.DatabaseManager
return type fi.utu.tuha.domain.Mainsubjects is not compatible with java.util.List<fi.utu.tuha.domain.Mainsubjects>
I wonder why. I’m casting the object to return it.
It looks like
DatabaseOperationsimplements the interface, or extends the classDatabaseManager. This interface or base class has the method:You have overriden the method with:
The cause of the error is that the return types do not match.