How to return two strings in one return statement in java? -


@suppresswarnings("unchecked") public tblseed getseed(string tablename, string tablename1) {     session session = this.sessionfactory.getcurrentsession();          list<tblseed> list = new arraylist<tblseed>();         tblseed tblseed = null;         try{             query query = session.createquery("from tblseed seedname =:tablename");             query.setparameter("tablename", tablename);             query query1 = session                 .createquery("from tblseed seedname =:tablename1");             query.setparameter("tablename1", tablename1);             list = query.list();             if (list!=null && list.size()>0) {                 tblseed = list.get(0);             }             list = query1.list();             if (list != null && list.size() > 0) {                 tblseed = list.get(0);             }         }catch(exception ex){             tblseed = null;             logger.error("exception:",ex);         }         return tblseed;  } 

error- getting error parameter tablename1 couldn't locate while returning tblseed.

plz tell me how can ?

the above code rather cryptic , question off topic problem. issue got. executing 2 hibernate queries query , query1. specify stacktrace posting question.

the erroneous line is

query.setparameter("tablename1", tablename1);  

make changes as:

query1.setparameter("tablename1", tablename1); 

Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -