Hi!
I've managed to get Request Factory to work somewhat, but I'm stuck at
a point where I attempt to execute this code in my client Activity
class:
AppRequestFactory factory = clientfactory.getAppRequestFactory();
EmployeeProxy employeeProxy =
factory.employeeRequest().create(EmployeeProxy.class);
employeeProxy.setDepartment("New Department");
employeeProxy.setUserName("Owen");
employeeProxy.setPassword("password");
factory.employeeRequest().getStatus(employeeProxy).fire(new
Receiver<String>() {
...
}
If I pass my entity proxy, the method does not fire any of the
Receiver callback methods and no server errors are reported on the
Eclipse console. But if I modify the expected parameter to a primitive
type or remove it altogether, I get a successful response. So I
suspect there is something wrong with the way I defined my one of my
request factory objects but a solution still eludes me...
My Proxy Class:
@ProxyForName(value="com.systemacorp.starter.server.domain.Employee",
locator="com.systemacorp.starter.server.domain.EmployeeLocator")
public interface EmployeeProxy extends EntityProxy {
String getUserName();
String getDepartment();
String getPassword();
void setUserName(String userName);
void setDepartment(String department);
void setPassword(String password);
Long getId();
Integer getVersion();
}
My Request Class:
@ServiceName(value="com.systemacorp.starter.server.domain.EmployeeServiceInt",
locator="com.systemacorp.starter.server.domain.EmployeeServiceLocator")
public interface EmployeeRequest extends RequestContext {
Request<Long> countEmployees();
Request<String> getStatus(EmployeeProxy instance);
Request<Void> add(EmployeeProxy instance);
Request<Void> delete(EmployeeProxy instance);
}
My Domain Class:
@Entity
public class Employee {
private String userName;
private String department;
private String password;
@Id
@Column(name = "id")
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@Version
@Column(name = "version")
private Integer version;
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getDepartment() {
return department;
}
public void setDepartment(String department) {
this.department = department;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Integer getVersion() {
return version;
}
public void setVersion(Integer version) {
this.version = version;
}
}
If more sample code is needed, just let me know.
--
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-web-toolkit?hl=en.