Hey Timothy,
yes you are allright and a colleague and me found out that we have to transform the object in the RPC call. Therefore gwt offers a method :
net.sf.gilead.gwt.clone(Object hibernatePojo)
this transforms the object to POJO.
Thanks for your post!
Am Donnerstag, 31. Juli 2014 16:02:11 UTC+2 schrieb Timothy Spear:
-- yes you are allright and a colleague and me found out that we have to transform the object in the RPC call. Therefore gwt offers a method :
net.sf.gilead.gwt.clone(Object hibernatePojo)
this transforms the object to POJO.
Thanks for your post!
Am Donnerstag, 31. Juli 2014 16:02:11 UTC+2 schrieb Timothy Spear:
The basic answer is you cannot. You will need to transform the Hibernate object into a POJO to make it serial, this is a requirement of any object being passed between the client and the server in GWT.Tim...On Jul 30, 2014, at 5:07 AM, Peter S. <stoffel...@googlemail.com> wrote: Hey all,
after searching the complete web for a solution and didn't find one, I will try to share my problem with you ;)..
Well I have the famous failure with GWT and Hibernate:
java.lang.RuntimeException: com.google.gwt.user.client.rpc.SerializationException: Type 'org.hibernate.collection. PersistentSet' was not included in the set of types which can be serialized by this SerializationPolicy or its Class object could not be loaded. For security purposes, this type will not be serialized.: instance = []
I have a hbm.xml file where Hibernate generates an Entity.<class abstract="false"
name="com.egrima.webinfotools.common.entity.PointOfInterest"
table="witpois">
<meta attribute="extends">net.sf.gilead.pojo.gwt.LightEntity</ meta> <!-- This was a try but also didn't work. so that line is not implemented in general -->
<meta attribute="implements">com.egrima.webinfotools.common. entity.BasisEntity</meta>
<id column="ID" name="id" type="java.lang.Long">
<generator class="sequence">
<param name="sequence">SEQ_WITPOIS</param>
</generator>
</id>
<property column="ZALTKN" generated="never" lazy="false"
name="zaltkn" length="6" type="java.lang.String" />
<property column="NAME" generated="never" lazy="false" name="name"
length="255" type="java.lang.String" />
<property column="ADDRESS" generated="never" lazy="false"
name="address" length="512" type="java.lang.String" />
<property column="LONGITUDE" generated="never" lazy="false"
name="longitude" type="java.lang.Double" />
<property column="LATITUDE" generated="never" lazy="false"
name="latitude" type="java.lang.Double" />
<property column="ANL_DAT_ZEIT" generated="never" lazy="false"
name="createdDate" type="java.util.Date" />
<property column="AEN_DAT_ZEIT" generated="never" lazy="false"
name="changedDate" type="java.util.Date" />
<property column="TERM" generated="never" name="hostname"
length="12" type="java.lang.String" />
<property column="BEN" generated="never" name="username"
length="8" type="java.lang.String" />
<many-to-one name="category" foreign-key="fk_poi_category" cascade="all"
column="category_id" lazy="false" class="com.egrima.webinfotools.common.entity. />generated. PointOfInterestCategory"
<one-to-one name="poiNameTranslation" lazy="false" cascade="all" foreign-key="fk_witpoi_translation" class="com.egrima.webinfotools.common.entity. />generated. PointOfInterestTranslation"
<set name="attributes" inverse="true" table="witpoi_attribute" lazy="false" cascade="all" fetch="select">
<key column="POI_ID"/>
<many-to-many class="com.egrima.webinfotools.common.entity. column="ATTRIBUTE_ID" fetch="join"/>generated. PointOfInterestAttribute"
</set>
</class>
The generated Class looks like this:package com.egrima.webinfotools.common
. entity;
// Generated 30.07.2014 10:56:07 by Hibernate Tools 3.2.2.GA
import com.egrima.webinfotools.common. entity.generated.PointOfInterestAttribute ;
import com.egrima.webinfotools.common. entity.generated.PointOfInterestCategory ;
import com.egrima.webinfotools.common. entity.generated.PointOfInterestTranslation ;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
/**
* PointOfInterest generated by hbm2java
*/
public class PointOfInterest implements com.egrima.webinfotools.common. entity.BasisEntity,java.io.Serializable {
private static final long serialVersionUID = 42L;
private Long id;
private String zaltkn;
private String name;
private String address;
private Double longitude;
private Double latitude;
private Date createdDate;
private Date changedDate;
private String hostname;
private String username;
private PointOfInterestCategory category;
private PointOfInterestTranslation poiNameTranslation;
private Set<PointOfInterestAttribute> attributes = new HashSet<PointOfInterestAttribute >(0);
public PointOfInterest() {
}
public PointOfInterest(String zaltkn, String name, String address, Double longitude, Double latitude, Date createdDate, Date changedDate, String hostname, String username, PointOfInterestCategory category, PointOfInterestTranslation poiNameTranslation, Set<PointOfInterestAttribute> attributes) {
this.zaltkn = zaltkn;
this.name = name;
this.address = address;
this.longitude = longitude;
this.latitude = latitude;
this.createdDate = createdDate;
this.changedDate = changedDate;
this.hostname = hostname;
this.username = username;
this.category = category;
this.poiNameTranslation = poiNameTranslation;
this.attributes = attributes;
}
@Override
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getZaltkn() {
return zaltkn;
}
&n
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-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment