关于对象工厂的错误

关于对象工厂的错误

本文介绍了关于对象工厂的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

public static EmployeeResponse searchByEmployeeid(String key)
            throws SQLException, ClassNotFoundException {
        if (null != key) {
            System.out.println("Key in retrieval" + key);
            System.out.println("SearchRetrieval Dao");

            EmployeeResponse response = objectFactory.createEmployeeResponse();

            List<HashMap<String, String>> list = Searchdao
                    .selectDbEmployeeId(key);
            System.out.println("coming back to retreival");

            List<EmployeeResponseElement> empResponses = response
                    .getEmployeeResponseElement();

            System.out.println("coming back to retreival222");
            if (null != list) {
                EmployeeResponseElement retrievedResponse = null;
                HashMap<String, String> hashMap = null;
                System.out.println("coming back to retreival333");
                Iterator<HashMap<String, String>> itr = list.iterator();

                while (itr.hasNext()) {
                    hashMap = (HashMap<String, String>) itr.next();
                    System.out.println("coming back to retreival444");
                    retrievedResponse = objectFactory
                            .createEmployeeResponseEmployeeResponseElement();
                    System.out.println("coming back to retreival555");
                    retrievedResponse.setEmployeeID(hashMap.get("employeeID"));
                    retrievedResponse.setFirstName(hashMap.get("firstName"));
                    System.out.println(hashMap.get("firstName"));
                    retrievedResponse.setLastName(hashMap.get("lastName"));
                    retrievedResponse.setFatherName(hashMap.get("fatherName"));
                    retrievedResponse.setDOB(hashMap.get("DOB"));
                    retrievedResponse.setAddress(hashMap.get("Address"));

                    empResponses.add(retrievedResponse);

                }

            }

            return response;
        }


    }


EmployeeResponse响应= objectFactory.createEmployeeResponse();

System.out.println(检索中的键" +键);
System.out.println("SearchRetrieval Dao");
编译器打印这些sysout,但之后不会继续

编译器不执行此操作,我不知道那是什么错误.
请帮帮我.


EmployeeResponse response = objectFactory.createEmployeeResponse();

System.out.println("Key in retrieval" + key);
System.out.println("SearchRetrieval Dao");
Compiler printing these sysout but after that its not going

Compiler not going after this,i dont know what''s the error in that.
Please help me out.

推荐答案



这篇关于关于对象工厂的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 01:38