OK thank you :) , actually i resolved the problem by creating an extension 
of the service in wish i override the function list like this 



>     public List<Societe> list() throws ServiceException {
>          List<Societe> list = new ArrayList<Societe>();
>          List<Societe>    societes=new ArrayList<Societe>();
>             log.debug("debut de la recherche des objets    Societe ");
>             try {
>                  list = getSocieteDao().list();
>  
>             
>             if(list!=null){
>                 for(Societe societe :list){
>                 Societe s=new Societe();
>                 s.setNomsociete(societe.getNomsociete());
>                 societes.add(s);
>                 }
>             }
>                 log.debug("fin de recherche des objets Societe ");
>             } catch (Exception re) {
>                 log.error("erreur de recherche ", re);
>                 throw new ServiceException(
>                         "error lors de la recherche de l'objet Societe : "
>                                 + re.toString());
>             }
>             return societes;
>      }
>      
>


but i will use dto , i think it is better


thank you again 
Le mardi 11 juin 2013 15:15:36 UTC, Juan Pablo Gardella a écrit :
>
> See: 
> http://books.google.com.ar/books?id=OG816JSZYVcC&pg=PA159&lpg=PA159&dq=hibernate+filter+gwt&source=bl&ots=BM7BGKs_n6&sig=CXd4NoOk_Wu-_ixtoZhljgr0V8A&hl=es&sa=X&ei=eD63UfrXAcL84AOFm4HYBA&ved=0CEUQ6AEwAg#v=onepage&q=hibernate%20filter%20gwt&f=false
>
> This where I pick the idea and the implementation.
>
> And you can see alternatives here: 
> https://developers.google.com/web-toolkit/articles/using_gwt_with_hibernate<https://developers.google.com/web-toolkit/articles/using_gwt_with_hibernate?hl=es-ES>
>
> I prefer DTO + Dozzer.
>
> Juan
>
>
> 2013/6/11 Sahli Sabrina <sahli....@gmail.com <javascript:>>
>
>> Thank you a lot , can you explain me please how it works and how to use 
>> it? because  i don"nt use gin so i can't make the difference in code
>>
>>
>> Le mardi 11 juin 2013 14:57:31 UTC, Juan Pablo Gardella a écrit :
>>>
>>> The filter is: https://bitbucket.org/**gardellajuanpablo/gwt-sample/**
>>> src/**8aba86d82778cb3a6f48f4d5f60f21**d4134282b4/src/main/java/com/**
>>> foo/server/rpc/hibernate/**HibernateFilter.java?at=**default<https://bitbucket.org/gardellajuanpablo/gwt-sample/src/8aba86d82778cb3a6f48f4d5f60f21d4134282b4/src/main/java/com/foo/server/rpc/hibernate/HibernateFilter.java?at=default>
>>>
>>>
>>>
>>>
>>> 2013/6/11 Sahli Sabrina <sahli....@gmail.com>
>>>
>>> i  did'nt find the filter in your code . can you explain me please how 
>>>> did you do?
>>>>
>>>> thank you
>>>>
>>>> Le mardi 11 juin 2013 13:31:05 UTC, Juan Pablo Gardella a écrit :
>>>>>
>>>>> If you don't want use DTO pattern to transfer objects to UI, check 
>>>>> this 
>>>>> thread<https://groups.google.com/forum/?fromgroups#!topic/google-web-toolkit/fkbowz5-5do>.
>>>>>  
>>>>> I've implemented a filter that you can use to put null lazy relationships.
>>>>>
>>>>> The problem is very common in Hibernate, check in google. It happens 
>>>>> when you serialize the object with GWT-RPC.
>>>>>
>>>>>
>>>>> 2013/6/11 Sahli Sabrina <sahli....@gmail.com>
>>>>>
>>>>>> Hi everyOne,
>>>>>> when i try to get a list of object in "Societe" class  
>>>>>>
>>>>>>
>>>>>> i'm getting this exception
>>>>>>  
>>>>>>
>>>>>> LazyInitializationException] failed to lazily initialize a collection 
>>>>>>> of role: com.protid.prosa.shared.model.****bo.Commune.soumission, 
>>>>>>> no session or session was closed
>>>>>>> [INFO] org.hibernate.**LazyInitializati**onException: failed to 
>>>>>>> lazily initialize a collection of role: com.protid.prosa.shared.model.
>>>>>>> ****bo.Commune.soumission, no session or session was closed
>>>>>>>
>>>>>>  
>>>>>>
>>>>>> Notice that the class *Societe *have an attribute of type *Adresse*. 
>>>>>> the adresse has an attribute *Commune* . A set of "Soumission" are 
>>>>>> declared in *Commune* class by the annotation OneToMany like this
>>>>>>
>>>>>> @OneToMany(fetch = FetchType.LAZY, mappedBy="commune",**targetEntit**
>>>>>>> y=com.protid.prosa.**shared.**model.bo.Soumission.**class)
>>>>>>> @Cascade(value = {CascadeType.ALL })
>>>>>>> private Set<Soumission> soumission =new HashSet<Soumission>();
>>>>>>>
>>>>>>> public Set<Soumission> getSoumission(){
>>>>>>>     return soumission;
>>>>>>> }
>>>>>>>  
>>>>>>> }
>>>>>>>
>>>>>>
>>>>>>
>>>>>> i don't get where is the problem because i'm not looking  for the 
>>>>>> "soumission " objects in the Commune class !!!
>>>>>>
>>>>>>
>>>>>> here is my rpc cal function
>>>>>>
>>>>>>
>>>>>>
>>>>>> private void getCompany(){
>>>>>>>         
>>>>>>>         SocieteServiceAsync rpc=clientFactory.**getSocietese**
>>>>>>> rvicerpc();
>>>>>>>           
>>>>>>>  
>>>>>>>         AsyncCallback<List<Societe>> callback = new 
>>>>>>> AsyncCallback<List<Societe>>() {            
>>>>>>>             public void onFailure(Throwable caught) {
>>>>>>>                         
>>>>>>>                        }
>>>>>>>                       
>>>>>>>                      
>>>>>>>                     public void onSuccess(List<Societe> result) {
>>>>>>>                          
>>>>>>>                           if(result!=null){
>>>>>>>                               societe=result.get(0);
>>>>>>>                                result.get(0).getNomsociete();
>>>>>>>                         
>>>>>>>                           }
>>>>>>>                      
>>>>>>>                     }
>>>>>>>                     };
>>>>>>>                     
>>>>>>>                 rpc.list(callback);
>>>>>>>  
>>>>>>>                      
>>>>>>>     }
>>>>>>>
>>>>>>
>>>>>>
>>>>>> Please help, 
>>>>>>
>>>>>> Thank you
>>>>>>
>>>>>>  -- 
>>>>>> You received this message because you are subscribed to the Google 
>>>>>> Groups "Google Web Toolkit" group.
>>>>>> To unsubscribe from this group and stop receiving emails from it, 
>>>>>> send an email to google-web-toolkit+**unsubscribe**@googlegroups.com.
>>>>>> To post to this group, send email to google-we...@**googlegroups.com.
>>>>>>
>>>>>> Visit this group at http://groups.google.com/**group**
>>>>>> /google-web-toolkit?hl=en<http://groups.google.com/group/google-web-toolkit?hl=en>
>>>>>> **.
>>>>>> For more options, visit 
>>>>>> https://groups.google.com/**grou**ps/opt_out<https://groups.google.com/groups/opt_out>
>>>>>> .
>>>>>>  
>>>>>>  
>>>>>>
>>>>>
>>>>>  -- 
>>>> You received this message because you are subscribed to the Google 
>>>> Groups "Google Web Toolkit" group.
>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>> an email to google-web-toolkit+**unsubscr...@googlegroups.com.
>>>> To post to this group, send email to google-we...@**googlegroups.com.
>>>> Visit this group at http://groups.google.com/**
>>>> group/google-web-toolkit?hl=en<http://groups.google.com/group/google-web-toolkit?hl=en>
>>>> **.
>>>> For more options, visit 
>>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out>
>>>> .
>>>>  
>>>>  
>>>>
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Google Web Toolkit" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-web-toolkit+unsubscr...@googlegroups.com <javascript:>.
>> To post to this group, send email to 
>> google-we...@googlegroups.com<javascript:>
>> .
>> Visit this group at 
>> http://groups.google.com/group/google-web-toolkit?hl=en.
>> For more options, visit https://groups.google.com/groups/opt_out.
>>  
>>  
>>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit+unsubscr...@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to