Hi all,
please help me out,
In my project using GWT/RequestFactory , Hibernate with SQL server database.
now my problem is Display the Records or Data in client side , please tell me How to get the data from server.
below client side code.
// here fire method giving compile time error says The method fire(Receiver<Void>) in the type RequestContext is not applicable for the arguments (new Receiver<NameDataProxy>(){})
1)DemoRF.java
Send a request client to server
//button clickhandler
nameDataRequest.query().fire(new Receiver<NameDataProxy>() {
@Override
public void onSuccess(final NameDataProxy response) {
System.out.println("success...");
if (response == null) {
//some process
}
@ProxyFor(Contact.class)
2)NameDataProxy having all setter and getter methods
//.............
3) request interface methods
@Service(Contact.class)
public interface NameDataRequest extends RequestContext {
// Request<Long> count();
Request<List<NameDataProxy>> findNameData();
Request<List<NameDataProxy>> query();
.......................
.......................................
}
below server side code:
3)Contact.java
//here one method
.......
public static List<Contact> query() {
//EntityManager em =null;// entityManager();
try {
SessionFactory sf = new Configuration().configure().buildSessionFactory();
Session session = sf.openSession();
@SuppressWarnings("unused")
Transaction trans =session.beginTransaction();
Query q2 = session.createQuery("select cus from Contact cus");
@SuppressWarnings("unchecked")
List<Contact> conl = (List<Contact>)q2.list();
conl.size();
System.out.println( conl.size());
return conl;
} finally {
//conl.close();
}
}
........................
.........................
please tell me in my code where is the mistake or worng.
if you don't mind, send simple web application using GWT/RF sample code for me,
advance thanks.