views:

191

answers:

1

I'm using GraniteDS(2.1.0RC2) on GAE with JPA annotiations. I have following class on flex side:

[Bindable]
[RemoteClass(alias="models.User")]
public class User
{
    public var key :String;
    public var login :String;
}

and on java side:

@Entity
public class User {
  @Id
  @GeneratedValue(strategy = GenerationType.IDENTITY)
  private Key key;
  private String login;
}

Reportedly GraniteDS automatically maps Key class to String, but I receive something like this:

"[object Key]"

instead of e.g. 6 (just id/key of object).

I need proper value to update object.

I need Key field as primary key to have the working relations.

Setting key field as Number or int doesn't work either.

How to get this working ?

A: 

An additional setting in granite-config.xml file is needed:

<converters>
    <converter type="org.granite.messaging.amf.io.convert.impl.GAEKeyConverter"/>
</converters>

solved!