Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6333503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:28:28+00:00 2026-05-24T18:28:28+00:00

The method: public Mainsubjects getChosenMain(String loc, int id) { List list = hibernateTemplate.find(from Mainsubjects

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T18:28:28+00:00Added an answer on May 24, 2026 at 6:28 pm

    It looks like DatabaseOperations implements the interface, or extends the class DatabaseManager. This interface or base class has the method:

    public List<Mainsubjects> getChosenMain(String,int)
    

    You have overriden the method with:

    public Mainsubjects getChosenMain(String loc, int id)
    

    The cause of the error is that the return types do not match.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have a ResultSet method public ResultSet getItemPurchase(String Pid) which return a Data from
I have this search method: public List<Employeees> AutoSuggestEmployeee(string keyword, long employeeeTypeId, int count) {
I have a method Public Property ConfigKeys(ByVal keyName As String) As WinItUtils.Classes.ConfigKey Get Return
I have the following method: public string Phase(string phase) { return Phase 1; }
I have some async method public static Task<JObject> GetUser(NameValueCollection parameters) { return CallMethodApi(users.get, parameters,
here's the method: public static int chooseStrat () { String[] strats = new String[1]
main method: public static void main(String[] args) throws Exception { if (args.length != EXPECTED_NUMBER_OF_ARGUMENTS)
I have this method: public int Test() { ExternalClass cls = new ExternalClass(); return
I wrote a method public static final List<String> FooBar{ List<String> foobarlist = new ArrayList<String>();
Given my current extension method: public static List<char> rotate(this List<char> currentList, int periodes) {

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.