TransPort_Tracking
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.bestray.transtracking.dao.mapper;
import com.bestray.trastrack.domain.Address;
import com.bestray.trastrack.domain.Employee;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
import org.springframework.dao.DataAccessException;
import org.springframework.jdbc.core.ResultSetExtractor;
/**
*
* @author User1
*/
public class EmployeeResultSetExtractor implements ResultSetExtractor<Object>{
public Object extractData(ResultSet rs) throws SQLException,
DataAccessException{
List <Employee> emplist = new ArrayList<Employee>();
while (rs.next()) {
Employee employee = new Employee();
Address address = new Address();
employee.setId(rs.getLong("id"));
employee.setEmployee_Name(rs.getString("emp_name"));
employee.setEmployee_ShortName(rs.getString("emp_shortname"));
employee.setCategoryCodeId(rs.getLong("category_id"));
employee.setMarital_Status(rs.getString("marital_status"));
employee.setBirth_date(rs.getDate("birth_date"));
employee.setGender(rs.getString("gender"));
employee.setNationality(rs.getString("nationality"));
employee.setHire_date(rs.getDate("hire_date"));
employee.setEmployee_father_Name(rs.getString("father_name"));
employee.setPermanentAddressid(rs.getLong("prmnt_address_id"));
employee.setPresentAddressid(rs.getLong("prsnt_address_id"));
employee.setContact1(rs.getLong("contact_1"));
employee.setContact2(rs.getLong("contact_2"));
employee.setOpen_Balance(rs.getDouble("open_balance"));
employee.setBalance_Type(rs.getString("balance_mode"));
employee.setLock(rs.getString("lock"));
employee.setEmployee_mother_Name(rs.getString("mother_name"));
emplist.add(employee);
}
return emplist;
}
}
|
Revision |
Author |
Commited |
Message |
1
|
girijabapi
|
Sat 28 Jul, 2018 05:29:14 +0000 |
|