Hi, we are working with Fahrettin and after some digging into the
framework we figured out how this problem occurs and used a
workaround. Sharing it with you so any other poor soul out there
looking for an answer to this problem might save the torture.
Here it goes:
The problem with java.lang.Long is on the flex side this type
corresponds to Number, which is also used for any fractional number
(i.e double or float) long integer as in Long. Also it might sometimes
be interpreted as int.
As I understand it, Number can be interpreted as integer or double
when it arrives to server depending on its value. For example if you
have an object with proxyKey value 1, it will be interpreted as
Integer on the server even though you defined proxyKey as Long(on
server). On the other hand if you have a 17 digit number as your
proxyKey it probably will be interpreted as Double when it arrives to
server. (I actually never seen it interpreted as Long it either gets
Integer or Double I think)
The problem roots from nature of type Number in Action Script.
How can the problem be solved then? Well it depends...
If you have mixed id types (i.e. Integer and Long) then you are in
trouble since there is no way of knowing which type it is when it
arrives to server. But if you have only Long id's as we do, you can
change a few places in the dpHibernate code (doing something like new
Long (incomingProxyKey + "")) and make it work for you. But with this
workaround you will make the framework incompatible with any id types
other than Long.
Although I think it is the shortcoming of action script in my opinion
(not having a seperate type for Long) to make dpHibernate work with
all types as id's, I see no other way than to send another field that
contains the type of id as part of proxy information saying "this is
supposed to be java.lang.Integer" or "this is supposed to be
java.lang.Long".
I hope it helps. And thanks to the dpHibernate team for the
framework :)
Umut