Re: [flexcoders] Re: Flex2/EJB3 integration: problems mapping Java/AS3 classes

2006-04-17 Thread Xavi Beumala



Is there any planned date for beta 3 release? Is it near?Thanks a lotX.On 4/17/06, Xavi Beumala <[EMAIL PROTECTED]
> wrote:Is there any planned date for beta 3 release? Is it near?
Thanks a lotX.On 4/17/06, 
Peter Farland <
[EMAIL PROTECTED]> wrote:






It might simply be a problem in the beta 2 player, as I 
have registerClassAlias working for AMF 0 using a beta 3 player (not yet 
released, obviously).


From: flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On Behalf Of Xavi 
BeumalaSent: Monday, April 17, 2006 5:05 AMTo: 
flexcoders@yahoogroups.comSubject: Re: [flexcoders] Re: Flex2/EJB3 
integration: problems mapping Java/AS3 classes
Hi,I'm having the same problem with plain and simple Java 
classes with amf0. Serialization works like a charm from as3 to java, but it's 
not working from java to as3. The java class I'm using is what follows: 
package com.code4net.vos;public class PhotoVO 
{    private String title;    private 
String photoURL;    public String getPhotoURL() 
{        return 
photoURL;    }    public void 
setPhotoURL(String photoURL) {        
this.photoURL = photoURL;    }    public 
String getTitle() {        return 
title;    }    public void setTitle(String 
title) {        this.title = 
title;    }}It doesn't have 
any inheritance and it's really simple. I also thought [RemoteClass] wouldn't 
work with amf0 so I tried using flash.net.registerClassAlias but didn't work for 
me :-( It seems like custom objects aren't being casted when they arrive to 
flash player. Same code is working on AS2 so I think it's not a server side 
problem... Would be great to have this solved so it's really annoying to 
implement a custom deserialization method for each VO.Any help is much 
apreciated!Thanks X.
On 4/17/06, carlos.rovira <

[EMAIL PROTECTED]> 
wrote:
Hi 
  Matt,There's no extra space in [RemoteClass] maybe a typo due to the 
  copypaste to the mail.I should point that I'm using AMF0, with 
  OpenAMF, I forget to mention,sorry. And I was able to send the Employee 
  class and operate in the backend, but the problem is in the return that I 
  must to use a plainObject in the client.In the debug panel I could see 
  that I'm sending an Employee Object.Maybe the [RemoteClass] doesn't 
  work with AMF0? btw, what do you mean with"It's not maybe some 
  weird implementation class that extends Employee?"The class must be 
  compiled with JDK1.5, and all the project as well,due that I'm using 
  annotations. Maybe this could be the problem? I saw another mail in 
  the list from Xavi Beaumala with the sameproblem, hope someone could give 
  us some lightThanks for any suggestion!C.--- In flexcoders@yahoogroups.com

, "Matt 
  Chotin" <[EMAIL PROTECTED]> wrote:>> Only thing I can see is the 
  extra space in your [RemoteClass] which I> would hope would not cause 
  the mismatch.  If you enable the debug logs > when the object 
  is sent from the server to the client does the log have> the correct 
  type of the Employee?  It's not maybe some weird> 
  implementation class that extends Employee?>>>> 
  Matt>>>> 
  >> From: flexcoders@yahoogroups.com 
  [mailto: 
  flexcoders@yahoogroups.com] On> Behalf Of Carlos Rovira> 
  Sent: Saturday, April 15, 2006 3:59 PM> To: flexcoders@yahoogroups.com> 
  Subject: [flexcoders] Re: Flex2/EJB3 integration: problems mapping > 
  Java/AS3 classes>>>> ok, I though I should post 
  the Employee classes as well:>> the AS3:> --> 
  package org.objectweb.easybeans.examples.entitybean {> 
  > [Bindable]>> 
  [RemoteClass(alias="org.objectweb.easybeans.examples.entitybean.Employee> 
  ")]> public class Employee 
  {> public var 
  id:int;> public var 
  name:String; > }> }>> 
  --> the Java one:>> /**>  * 
  EasyBeans>  * Copyright (C) 2006 Bull 
  S.A.S.>  * Contact: 
  [EMAIL PROTECTED]>  *>  * This library is free 
  software; you can redistribute it and/or >  * modify it under 
  the terms of the GNU Lesser General Public>  * License as 
  published by the Free Software Foundation; either>  * version 
  2.1 of the License, or any later 
  version.>  *>  * This library is distributed 
  in the hope that it will be useful, >  * but WITHOUT ANY 
  WARRANTY; without even the implied warranty of>  * 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
  GNU>  * Lesser General Public License for more 
  details.>  * >  * You should have received a 
  copy of the GNU Lesser General Public>  * License along with 
  this library; if not, write to the Free Software>  * 
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 

Re: [flexcoders] Re: Flex2/EJB3 integration: problems mapping Java/AS3 classes

2006-04-17 Thread Carlos Rovira



Hi Peter,Is great to hear that. We should wait to beta 3 release.Thanks for the feedbackOn 4/17/06, Peter Farland <
[EMAIL PROTECTED]> wrote:






It might simply be a problem in the beta 2 player, as I 
have registerClassAlias working for AMF 0 using a beta 3 player (not yet 
released, obviously).


From: flexcoders@yahoogroups.com 
[mailto:flexcoders@yahoogroups.com] On Behalf Of Xavi 
BeumalaSent: Monday, April 17, 2006 5:05 AMTo: 
flexcoders@yahoogroups.comSubject: Re: [flexcoders] Re: Flex2/EJB3 
integration: problems mapping Java/AS3 classes
Hi,I'm having the same problem with plain and simple Java 
classes with amf0. Serialization works like a charm from as3 to java, but it's 
not working from java to as3. The java class I'm using is what follows: 
package com.code4net.vos;public class PhotoVO 
{    private String title;    private 
String photoURL;    public String getPhotoURL() 
{        return 
photoURL;    }    public void 
setPhotoURL(String photoURL) {        
this.photoURL = photoURL;    }    public 
String getTitle() {        return 
title;    }    public void setTitle(String 
title) {        this.title = 
title;    }}It doesn't have 
any inheritance and it's really simple. I also thought [RemoteClass] wouldn't 
work with amf0 so I tried using flash.net.registerClassAlias but didn't work for 
me :-( It seems like custom objects aren't being casted when they arrive to 
flash player. Same code is working on AS2 so I think it's not a server side 
problem... Would be great to have this solved so it's really annoying to 
implement a custom deserialization method for each VO.Any help is much 
apreciated!Thanks X.
On 4/17/06, carlos.rovira <
[EMAIL PROTECTED]> 
wrote:
Hi 
  Matt,There's no extra space in [RemoteClass] maybe a typo due to the 
  copypaste to the mail.I should point that I'm using AMF0, with 
  OpenAMF, I forget to mention,sorry. And I was able to send the Employee 
  class and operate in the backend, but the problem is in the return that I 
  must to use a plainObject in the client.In the debug panel I could see 
  that I'm sending an Employee Object.Maybe the [RemoteClass] doesn't 
  work with AMF0? btw, what do you mean with"It's not maybe some 
  weird implementation class that extends Employee?"The class must be 
  compiled with JDK1.5, and all the project as well,due that I'm using 
  annotations. Maybe this could be the problem? I saw another mail in 
  the list from Xavi Beaumala with the sameproblem, hope someone could give 
  us some lightThanks for any suggestion!C.--- In flexcoders@yahoogroups.com
, "Matt 
  Chotin" <[EMAIL PROTECTED]> wrote:>> Only thing I can see is the 
  extra space in your [RemoteClass] which I> would hope would not cause 
  the mismatch.  If you enable the debug logs > when the object 
  is sent from the server to the client does the log have> the correct 
  type of the Employee?  It's not maybe some weird> 
  implementation class that extends Employee?>>>> 
  Matt>>>> 
  >> From: flexcoders@yahoogroups.com 
  [mailto: 
  flexcoders@yahoogroups.com] On> Behalf Of Carlos Rovira> 
  Sent: Saturday, April 15, 2006 3:59 PM> To: flexcoders@yahoogroups.com> 
  Subject: [flexcoders] Re: Flex2/EJB3 integration: problems mapping > 
  Java/AS3 classes>>>> ok, I though I should post 
  the Employee classes as well:>> the AS3:> --> 
  package org.objectweb.easybeans.examples.entitybean {> 
  > [Bindable]>> 
  [RemoteClass(alias="org.objectweb.easybeans.examples.entitybean.Employee> 
  ")]> public class Employee 
  {> public var 
  id:int;> public var 
  name:String; > }> }>> 
  --> the Java one:>> /**>  * 
  EasyBeans>  * Copyright (C) 2006 Bull 
  S.A.S.>  * Contact: 
  [EMAIL PROTECTED]>  *>  * This library is free 
  software; you can redistribute it and/or >  * modify it under 
  the terms of the GNU Lesser General Public>  * License as 
  published by the Free Software Foundation; either>  * version 
  2.1 of the License, or any later 
  version.>  *>  * This library is distributed 
  in the hope that it will be useful, >  * but WITHOUT ANY 
  WARRANTY; without even the implied warranty of>  * 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
  GNU>  * Lesser General Public License for more 
  details.>  * >  * You should have received a 
  copy of the GNU Lesser General Public>  * License along with 
  this library; if not, write to the Free Software>  * 
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
  >  * USA>  *>  *> 
  > 
  -->  * $Id: Emp

RE: [flexcoders] Re: Flex2/EJB3 integration: problems mapping Java/AS3 classes

2006-04-17 Thread Peter Farland





It might simply be a problem in the beta 2 player, as I 
have registerClassAlias working for AMF 0 using a beta 3 player (not yet 
released, obviously).


From: flexcoders@yahoogroups.com 
[mailto:[EMAIL PROTECTED] On Behalf Of Xavi 
BeumalaSent: Monday, April 17, 2006 5:05 AMTo: 
flexcoders@yahoogroups.comSubject: Re: [flexcoders] Re: Flex2/EJB3 
integration: problems mapping Java/AS3 classes
Hi,I'm having the same problem with plain and simple Java 
classes with amf0. Serialization works like a charm from as3 to java, but it's 
not working from java to as3. The java class I'm using is what follows: 
package com.code4net.vos;public class PhotoVO 
{    private String title;    private 
String photoURL;    public String getPhotoURL() 
{        return 
photoURL;    }    public void 
setPhotoURL(String photoURL) {        
this.photoURL = photoURL;    }    public 
String getTitle() {        return 
title;    }    public void setTitle(String 
title) {        this.title = 
title;    }}It doesn't have 
any inheritance and it's really simple. I also thought [RemoteClass] wouldn't 
work with amf0 so I tried using flash.net.registerClassAlias but didn't work for 
me :-( It seems like custom objects aren't being casted when they arrive to 
flash player. Same code is working on AS2 so I think it's not a server side 
problem... Would be great to have this solved so it's really annoying to 
implement a custom deserialization method for each VO.Any help is much 
apreciated!Thanks X.
On 4/17/06, carlos.rovira <[EMAIL PROTECTED]> 
wrote:
Hi 
  Matt,There's no extra space in [RemoteClass] maybe a typo due to the 
  copypaste to the mail.I should point that I'm using AMF0, with 
  OpenAMF, I forget to mention,sorry. And I was able to send the Employee 
  class and operate in the backend, but the problem is in the return that I 
  must to use a plainObject in the client.In the debug panel I could see 
  that I'm sending an Employee Object.Maybe the [RemoteClass] doesn't 
  work with AMF0? btw, what do you mean with"It's not maybe some 
  weird implementation class that extends Employee?"The class must be 
  compiled with JDK1.5, and all the project as well,due that I'm using 
  annotations. Maybe this could be the problem? I saw another mail in 
  the list from Xavi Beaumala with the sameproblem, hope someone could give 
  us some lightThanks for any suggestion!C.--- In flexcoders@yahoogroups.com, "Matt 
  Chotin" <[EMAIL PROTECTED]> wrote:>> Only thing I can see is the 
  extra space in your [RemoteClass] which I> would hope would not cause 
  the mismatch.  If you enable the debug logs > when the object 
  is sent from the server to the client does the log have> the correct 
  type of the Employee?  It's not maybe some weird> 
  implementation class that extends Employee?>>>> 
  Matt>>>> 
  >> From: flexcoders@yahoogroups.com 
  [mailto: 
  flexcoders@yahoogroups.com] On> Behalf Of Carlos Rovira> 
  Sent: Saturday, April 15, 2006 3:59 PM> To: flexcoders@yahoogroups.com> 
  Subject: [flexcoders] Re: Flex2/EJB3 integration: problems mapping > 
  Java/AS3 classes>>>> ok, I though I should post 
  the Employee classes as well:>> the AS3:> --> 
  package org.objectweb.easybeans.examples.entitybean {> 
  > [Bindable]>> 
  [RemoteClass(alias="org.objectweb.easybeans.examples.entitybean.Employee> 
  ")]> public class Employee 
  {> public var 
  id:int;> public var 
  name:String; > }> }>> 
  --> the Java one:>> /**>  * 
  EasyBeans>  * Copyright (C) 2006 Bull 
  S.A.S.>  * Contact: 
  [EMAIL PROTECTED]>  *>  * This library is free 
  software; you can redistribute it and/or >  * modify it under 
  the terms of the GNU Lesser General Public>  * License as 
  published by the Free Software Foundation; either>  * version 
  2.1 of the License, or any later 
  version.>  *>  * This library is distributed 
  in the hope that it will be useful, >  * but WITHOUT ANY 
  WARRANTY; without even the implied warranty of>  * 
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the 
  GNU>  * Lesser General Public License for more 
  details.>  * >  * You should have received a 
  copy of the GNU Lesser General Public>  * License along with 
  this library; if not, write to the Free Software>  * 
  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 
  >  * USA>  *>  *> 
  > 
  -->  * $Id: Employee.java 9 2006-02-19 18:53:32Z benoitf 
  $>  *> 
   
  > -->  */>>

Re: [flexcoders] Re: Flex2/EJB3 integration: problems mapping Java/AS3 classes

2006-04-17 Thread Carlos Rovira



Hi Xavi,I thought the same about [RemoteClass]...maybe it doesn't work with AMF0?Hope some guys of the Flex team could throw some light about this issue :)C.
On 4/17/06, Xavi Beumala <[EMAIL PROTECTED]> wrote:



Hi,I'm having the same problem with plain and simple Java
classes with amf0. Serialization works like a charm from as3 to java,
but it's not working from java to as3. The java class I'm using is what follows:
package com.code4net.vos;public class PhotoVO {    private String title;    private String photoURL;    public String getPhotoURL() {        return photoURL;    }


    public void setPhotoURL(String photoURL) {        this.photoURL = photoURL;    }    public String getTitle() {        return title;    }    public void setTitle(String title) {        this.title


 = title;    }}It
doesn't have any inheritance and it's really simple. I also thought
[RemoteClass] wouldn't work with amf0 so I tried using
flash.net.registerClassAlias but didn't work for me :-( It seems like
custom objects aren't being casted when they arrive to flash player.
Same code is working on AS2 so I think it's not a server side
problem...
Would be great to have this solved so it's really annoying to implement a custom deserialization method for each VO.Any help is much apreciated!Thanks X.
On 4/17/06, 
carlos.rovira <[EMAIL PROTECTED]> wrote:

Hi Matt,There's no extra space in [RemoteClass] maybe a typo due to the copypaste to the mail.I should point that I'm using AMF0, with OpenAMF, I forget to mention,sorry. And I was able to send the Employee class and operate in the
backend, but the problem is in the return that I must to use a plainObject in the client.In the debug panel I could see that I'm sending an Employee Object.Maybe the [RemoteClass] doesn't work with AMF0?
btw, what do you mean with"It's not maybe some weird implementation class that extends Employee?"The class must be compiled with JDK1.5, and all the project as well,due that I'm using annotations. Maybe this could be the problem?
I saw another mail in the list from Xavi Beaumala with the sameproblem, hope someone could give us some lightThanks for any suggestion!C.--- In 

flexcoders@yahoogroups.com, "Matt Chotin" <[EMAIL PROTECTED]> wrote:>> Only thing I can see is the extra space in your [RemoteClass] which I> would hope would not cause the mismatch.  If you enable the debug logs
> when the object is sent from the server to the client does the log have> the correct type of the Employee?  It's not maybe some weird> implementation class that extends Employee?>>

>> Matt >> From: 
flexcoders@yahoogroups.com [mailto:
flexcoders@yahoogroups.com] On> Behalf Of Carlos Rovira> Sent: Saturday, April 15, 2006 3:59 PM> To: 
flexcoders@yahoogroups.com> Subject: [flexcoders] Re: Flex2/EJB3 integration: problems mapping
> Java/AS3 classes ok, I though I should post the Employee classes as well:>> the AS3:
> --> package org.objectweb.easybeans.examples.entitybean {>
> [Bindable]>> [RemoteClass(alias="org.objectweb.easybeans.examples.entitybean.Employee> ")]> public class Employee {> public var id:int;> public var name:String;
> }> }>> --> the Java one:>> /**>  * EasyBeans>  * Copyright (C) 2006 Bull S.A.S.>  * Contact: [EMAIL PROTECTED]
>  *>  * This library is free software; you can redistribute it and/or
>  * modify it under the terms of the GNU Lesser General Public>  * License as published by the Free Software Foundation; either>  * version 2.1 of the License, or any later version.>  *>  * This library is distributed in the hope that it will be useful,
>  * but WITHOUT ANY WARRANTY; without even the implied warranty of>  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU>  * Lesser General Public License for more details.>  *
>  * You should have received a copy of the GNU Lesser General Public>  * License along with this library; if not, write to the Free Software>  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
>  * USA>  *>  *> > -->  * $Id: Employee.java 9 2006-02-19 18:53:32Z benoitf $>  *> 
> -->  */>> package org.objectweb.easybeans.examples.entitybean;>> import javax.persistence.Entity;> import 
javax.persistence.Id;
> import javax.persistence.Table;>> /**>  * Define an employee with an id and a name.>  * @author Florent Benoit>  */> @Entity> @Table(name = "EMPLOYEES")
> public class Employee implements 
java.io.Serializable {>> /**>  * Id for serializable class.>  */> private static final long serialVersionUID = -236627462547454L;>> /**>  * Id of this employee.
>  */> private int id;>> /**>  * Name of the employee.>  */> private String name;>> /**>  * Gets the Id of the employee.
>  * @return the id of the employee.>  */> @Id

Re: [flexcoders] Re: Flex2/EJB3 integration: problems mapping Java/AS3 classes

2006-04-17 Thread Xavi Beumala



Hi,I'm having the same problem with plain and simple Java
classes with amf0. Serialization works like a charm from as3 to java,
but it's not working from java to as3. The java class I'm using is what follows:
package com.code4net.vos;public class PhotoVO {    private String title;    private String photoURL;    public String getPhotoURL() {        return photoURL;    }

    public void setPhotoURL(String photoURL) {        this.photoURL = photoURL;    }    public String getTitle() {        return title;    }    public void setTitle(String title) {        this.title

 = title;    }}It
doesn't have any inheritance and it's really simple. I also thought
[RemoteClass] wouldn't work with amf0 so I tried using
flash.net.registerClassAlias but didn't work for me :-( It seems like
custom objects aren't being casted when they arrive to flash player.
Same code is working on AS2 so I think it's not a server side
problem...
Would be great to have this solved so it's really annoying to implement a custom deserialization method for each VO.Any help is much apreciated!Thanks X.On 4/17/06, 
carlos.rovira <[EMAIL PROTECTED]> wrote:
Hi Matt,There's no extra space in [RemoteClass] maybe a typo due to the copypaste to the mail.I should point that I'm using AMF0, with OpenAMF, I forget to mention,sorry. And I was able to send the Employee class and operate in the
backend, but the problem is in the return that I must to use a plainObject in the client.In the debug panel I could see that I'm sending an Employee Object.Maybe the [RemoteClass] doesn't work with AMF0?
btw, what do you mean with"It's not maybe some weird implementation class that extends Employee?"The class must be compiled with JDK1.5, and all the project as well,due that I'm using annotations. Maybe this could be the problem?
I saw another mail in the list from Xavi Beaumala with the sameproblem, hope someone could give us some lightThanks for any suggestion!C.--- In 
flexcoders@yahoogroups.com, "Matt Chotin" <[EMAIL PROTECTED]> wrote:>> Only thing I can see is the extra space in your [RemoteClass] which I> would hope would not cause the mismatch.  If you enable the debug logs
> when the object is sent from the server to the client does the log have> the correct type of the Employee?  It's not maybe some weird> implementation class that extends Employee?>>
>> Matt >> From: flexcoders@yahoogroups.com [mailto:
flexcoders@yahoogroups.com] On> Behalf Of Carlos Rovira> Sent: Saturday, April 15, 2006 3:59 PM> To: flexcoders@yahoogroups.com> Subject: [flexcoders] Re: Flex2/EJB3 integration: problems mapping
> Java/AS3 classes ok, I though I should post the Employee classes as well:>> the AS3:> --> package org.objectweb.easybeans.examples.entitybean {>
> [Bindable]>> [RemoteClass(alias="org.objectweb.easybeans.examples.entitybean.Employee> ")]> public class Employee {> public var id:int;> public var name:String;
> }> }>> --> the Java one:>> /**>  * EasyBeans>  * Copyright (C) 2006 Bull S.A.S.>  * Contact: [EMAIL PROTECTED]>  *>  * This library is free software; you can redistribute it and/or
>  * modify it under the terms of the GNU Lesser General Public>  * License as published by the Free Software Foundation; either>  * version 2.1 of the License, or any later version.>  *>  * This library is distributed in the hope that it will be useful,
>  * but WITHOUT ANY WARRANTY; without even the implied warranty of>  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU>  * Lesser General Public License for more details.>  *
>  * You should have received a copy of the GNU Lesser General Public>  * License along with this library; if not, write to the Free Software>  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
>  * USA>  *>  *> > -->  * $Id: Employee.java 9 2006-02-19 18:53:32Z benoitf $>  *> 
> -->  */>> package org.objectweb.easybeans.examples.entitybean;>> import javax.persistence.Entity;> import javax.persistence.Id;
> import javax.persistence.Table;>> /**>  * Define an employee with an id and a name.>  * @author Florent Benoit>  */> @Entity> @Table(name = "EMPLOYEES")> public class Employee implements 
java.io.Serializable {>> /**>  * Id for serializable class.>  */> private static final long serialVersionUID = -236627462547454L;>> /**>  * Id of this employee.
>  */> private int id;>> /**>  * Name of the employee.>  */> private String name;>> /**>  * Gets the Id of the employee.
>  * @return the id of the employee.>  */> @Id> public int getId() {> return id;> }>> /**>  * Sets id of the employee.
>  * @param id the id's employee>  */> public void setId(final int id) {> this.id = id;> }>> /**>   

RE: [flexcoders] Re: Flex2/EJB3 integration: problems mapping Java/AS3 classes

2006-04-16 Thread Matt Chotin










Only thing I can see is the extra space in
your [RemoteClass] which I would hope would not cause the mismatch.  If you
enable the debug logs when the object is sent from the server to the client
does the log have the correct type of the Employee?  It’s not maybe some
weird implementation class that extends Employee?

 

Matt

 









From:
flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Carlos Rovira
Sent: Saturday, April 15, 2006
3:59 PM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re:
Flex2/EJB3 integration: problems mapping Java/AS3 classes



 

ok, I though I should post
the Employee classes as well:

the AS3:
--
package
org.objectweb.easybeans.examples.entitybean {
    
    [Bindable]
    [RemoteClass(alias="org.objectweb.easybeans.examples.entitybean.Employee
")]
    public class Employee {
        public var
id:int;
        public var
name:String;
    }
}

--
the Java one:

/**
 * EasyBeans
 * Copyright (C) 2006 Bull S.A.S.
 * Contact: [EMAIL PROTECTED]
 *
 * This library is free software; you can
redistribute it and/or
 * modify it under the terms of the GNU
Lesser General Public
 * License as published by the Free Software
Foundation; either 
 * version 2.1 of the License, or any later
version.
 *
 * This library is distributed in the hope
that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the
implied warranty of
 * MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.  See the GNU 
 * Lesser General Public License for more
details.
 *
 * You should have received a copy of the GNU
Lesser General Public
 * License along with this library; if not,
write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 MA  02111-1307

 * USA
 *
 *
--
 * $Id: Employee.java 9 2006-02-19 18:53:32Z
benoitf $
 *
-- 
 */

package org.objectweb.easybeans.examples.entitybean;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;

/**
 * Define an employee with an id and a name.
 * @author Florent Benoit
 */
@Entity
@Table(name = "EMPLOYEES")
public class Employee implements
java.io.Serializable {

    /**
 * Id for serializable
class. 
 */
    private static final long
serialVersionUID = -236627462547454L;

    /**
 * Id of this employee.
 */
    private int id;

    /**
 * Name of the employee.
 */ 
    private String name;

    /**
 * Gets the Id of the
employee.
 * @return the id of the
employee.
 */
    @Id
    public int getId() {
    return
id;
    }

    /**
 * Sets id of the
employee.
 * @param id the id's
employee
 */
    public void setId(final int id)
{
    this.id = id;
    }

    /**
 * Sets the name. 
 * @param name of
employee.
 */
    public void setName(final
String name) {
    this.name = name;
    }

    /**
 * Gets the name of the
employee.
 * @return name of the
employee.
 */
    public String getName() {
    return
name;
    }

    /**
 * Computes a string
representation of this employee.
 * @return string
representation. 
 */
    @Override
    public String toString() {
   
StringBuilder sb = new StringBuilder();
   
sb.append("Employee[id=").append(id).append(", name=").append(getName()).append("]");

    return
sb.toString();
    }

}




Thanks again :)






On 4/16/06, Carlos Rovira < [EMAIL PROTECTED]> wrote:



Hi,

I've been getting fun this weekend integrating Flex2 with ObjectWeb's EasyBeans
(an early EJB3 container implementation). 

I've been able to comunicate through remoting with stateless, stateful and
entity beans without problem, but with the last case (entity) I was trying to
map an Employee Java class to its corresponding AS3 version and I was not able
to do it. The result method working is the following (as you notice I'm using
Object and all works ok): 

public function onResultGet(emp:Object):void {
    result_lb.text = "Resultado: " + emp.name + "(id:" + emp.id + ")";
} 

But If I try something like:

public function onResultGet(result:Object):void {
    var emp:Employee = Employee(result);
    //or
   var emp:Employee = result as Employee;

    result_lb.text = "Resultado: " + emp.name + "(id:" + emp.id + ")";
}

I get a runtime player exception with messages pointing me to a Coercion
problem or something like that.

Could anyone tell me what's the correct _expression_ to handle an Employee object
without having errors?, I know the Employee is reaching my flash client
watching the traces in my server. 

Thanks in advance.






-- 
::| Carlos Rovira
::| http://www.carlosrovira.com









-- 
::| Carlos Rovira
::| http://www.carlosrovira.com








--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archiv