I'm currently working on an project, using Smartfox SF2X and Flash AS3 Client and got the following issue during serialization.
On client side I've the following model class:
Code: Select all
public class Person implements SerializableSFSType
{
public var id : int;
public var firstName : String;
public var lastName : String;
public function Person()
{
}
}
Code: Select all
@Entity
@Table(name="person")
public class Person extends PersonBase
{
private static final long serialVersionUID = 6258734904191561262L;
}
@MappedSuperclass
public class PersonBase implements Serializable, SerializableSFSType
{
private static final long serialVersionUID = 4812787344839070414L;
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
protected int id;
@Column(name="firstName")
protected String firstName;
@Column(name="lastName")
protected String lastName;
...getters/setters...
}
When I send an object to the backend I got the following error:
Error deserializing request: com.smartfoxserver.v2.exceptions.SFSRuntimeException: java.lang.NoSuchFieldException: id
When I put all properties and getter/setter from the PersonBase into the Person class that works fine, but I don't want to use that code style.
So is there a way to tell the backend to look for that values when serialization/reflection takes place?