Another workaround is use GraniteDS instead of BlazeDS. :D
On Thu, Apr 30, 2009 at 11:45 AM, aglosband <aglos...@adobe.com> wrote: > > > Hi Max. There was another bug logged to add support for Java 5.0 syntax > (which I take to mean Generics) to RemoteObjects. > > https://bugs.adobe.com/jira/browse/BLZ-115 > > That bug has unfortunately been deferred for the time being but I'd suggest > that you view the bug report and vote on it which will help the issue get > some visibility and hopefully get it fixed faster. > > There is a workaround for this issue which is outlined by wichan in this > bug report. > > https://bugs.adobe.com/jira/browse/BLZ-305 > > The workaround is to write a wrapper class for Long which then using a > BeanProxy will get mapped back to java.lang.Long before the remoting service > is called. > > Using this approach you would send a MyLong type across the wire from your > Flex application to the server. The MyLong type would get deserialized to > the MyLong java class which would then get passed through the BeanProxy (in > the example in the bug it's called MyLongProxy) and come out the other end > as a Long. This would then get passed to the remoting service. > > If you are passing an array collection of MyLong objects this would get > turned into a Set of Long objects so your RemoteObject code would not have > to change. > > Hope that helps. > > -Alex > > --- In flexcoders@yahoogroups.com <flexcoders%40yahoogroups.com>, > "max.bruchmann" <max.bruchm...@...> wrote: > > > > Hi, > > I am having some problems with blazeds and how it maps a collection > contains long elements. > > > > Let's assume I have a class > > > > public class MyClass { > > > > .. > > > > private Set<Long> myLongs; > > > > public void setMyLongs(Set<Long> myLongs){ > > this.myLongs = myLongs; > > } > > public Set<Long> getMyLongs(){ > > return myLongs; > > } > > } > > and I have a mapped class in flex and a instance of this class containing > an arraycollection with for example [1, 4] > > > > Now I'm sending this instance to my remoteobject > > > > .. > > public void receiveStuff(MyClass m){ > > > > .... > > } > > The problem I'm having now, is that blazeds actually mapped the 1 and 4 > not as a Long into myLongs but as a Integer. > > Sofar this is not a big issue, but I'm passing it forward to hibernate > and there it leads to some errors: > > > > > > org.hibernate.type.LongType - could not bind value ... to parameter: ... > > java.lang.Integer cannot be cast to java.lang.Long > > > > I found already some bug reports on that in > https://bugs.adobe.com/jira/browse/BLZ-79 but it's marked as resolve with > the solution "don't use java syntax 1.5" which is not very helpful. So if > someone has a solution/workarround/idea please let me know. > > > > Thanks in advance > > Max > > > > > -- /** * Pedro Sena * Systems Architect * Sun Certified Java Programmer * Sun Certified Web Component Developer */