Results 1 to 3 of 3

Thread: Java byte[] field generated as int instead of ByteArray on the Flex side

  1. #1
    Join Date
    Jul 2008
    Location
    Maasmechelen (Belgium)
    Posts
    157

    Question Java byte[] field generated as int instead of ByteArray on the Flex side

    Aloha!

    My byte[] field:

    PHP Code:
        @Lob
        
    @Basic(fetch FetchType.LAZY)
        @
    Column(name "source"columnDefinition "BLOB NOT NULL")
        @
    NotNull
        
    private byte[] source
    is generated as
    PHP Code:
        public var source:int
    on the Flex side.

    File a bug or am I just being stupid again?

    Thanks and great work so far on the project!

  2. #2
    Join Date
    Apr 2005
    Location
    San Francisco, CA
    Posts
    1,224

    Default

    I assume you're talking about Roo-generated code?

    The type mappings are based on the tables found here:
    http://help.adobe.com/en_US/LiveCycl...ffdUpdate.html

    Oddly, it shows that:
    - flash.utils.ByteArray maps to byte[] when going from ActionScript to Java
    - java.lang.Byte and byte[] map to int when going from Java to ActionScript
    - java.lang.Byte[] maps to flash.utils.ByteArray when going from Java to ActionScript

    Clearly something's not quite right there. I haven't tested to see if it will correctly map byte[] to flash.utils.ByteArray in practice. If it does, that definitely seems to make more sense, and a Jira would indeed be appropriate.
    Jeremy Grelle

    Staff Engineer, Web Products Team
    SpringSource

  3. #3
    Join Date
    Jul 2008
    Location
    Maasmechelen (Belgium)
    Posts
    157

    Default

    Quote Originally Posted by jeremyg484 View Post
    I assume you're talking about Roo-generated code?

    The type mappings are based on the tables found here:
    http://help.adobe.com/en_US/LiveCycl...ffdUpdate.html

    Oddly, it shows that:
    - flash.utils.ByteArray maps to byte[] when going from ActionScript to Java
    - java.lang.Byte and byte[] map to int when going from Java to ActionScript
    - java.lang.Byte[] maps to flash.utils.ByteArray when going from Java to ActionScript

    Clearly something's not quite right there. I haven't tested to see if it will correctly map byte[] to flash.utils.ByteArray in practice. If it does, that definitely seems to make more sense, and a Jira would indeed be appropriate.
    Indeed a Roo project.

    So I could work around using java.lang.Byte[] instead of byte[], nice to hear!

    I created: https://jira.springsource.org/browse/ROOFLEX-24

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •