tags:

views:

27

answers:

1

Hello All,

I wanted to understand the best way to integrate Gilead with GXT and hibernate. This article http://code.google.com/webtoolkit/articles/using_gwt_with_hibernate.html describes the usage of Gilead with GWT.

Most of the GXT components are bound using custom classes that inherit BaseModelData, does this mean we need to convert the bean that is persisted (LightEntity bean) to the custom class that extends BaseModelData before binding to the GXT compoenent. Is my understanding correct ? If yes, what is the advantage I get by doing this, I would need to use dozer/hand code conversion yet again ?

The examples on the gilead site as pathetic, can anyone provide a link where a complete example of using GXT with Gilead and hibernate is present ?

Thanks

A: 

You do not need to have your DAOs implement BaseModelData.

What you have to do is for each DAO class you create an interface in your GWT client package. You have to extend BeanModelMarker and use the @BEAN annotation. This tells EXT GWT that your DAO can be used as a BeanModel

package org.gwtapp.client.model;

import com.extjs.gxt.ui.client.data.BeanModelMarker;
import com.extjs.gxt.ui.client.data.BeanModelMarker.BEAN;

@BEAN(org.vnsny.domain.MyClass.class)
public interface MyClassBeanModel extends BeanModelMarker {

}

Then when you need to create a BeanModel from your class you use the BeanModelFactory

BeanModel model = BeanModelLookup.get().getFactory(
                MyClass.class).createModel(myClassObj);
stan229