I am using java/blazeds/flex. So basically I have method in java:
public ArrayList<Employee> getAllEmployees(){
...
ArrayList<Employee> employees = new ArrayList<Employee>();
pst = JavaConnection.getConnection()
.prepareStatement("select * from employee order by lastname");
rs = pst.executeQuery();
while (rs.next()){
Employee employee = new Employee();
employee.setId(rs.getInt("id"));
employee.setFirstName(rs.getString("firstName"));
employee.setLastName(rs.getString("lastName"));
employees.add(employee);
}
...
return employees;
}
but in flex from remoteobject result i get ArrayCollection where all elements are with Object
datatype but not with Employee
. By the way I also have have value object class in flex.
[RemoteClass(alias="domain.Employee")]
public class Employee
{
public var id:int;
public var firstName:String;
public var lastName:String;
...
}
So I am not sure why I get object datatype.
How to fix this?
Hope I made some sense, because I am not very good with terminology.