2 Replies Latest reply on Mar 5, 2002 12:00 PM by Erik Nord

    Object in CMP, no way to cast to my class

    Rogelio Triviño Newbie

      I'm using mysql and jboss 2.4.3. I have blob CMP fields in an entity bean. If I try to save an Object CMP, I can't use the object saved because jboss return byte[]. It doesn't mind my cast to the class that I know is inside the Object, used when I save into the entity bean and when I load the data.
      I would like to save different classes into the CMP, what can I do?
      thanks in advance.

        • 1. Re: Object in CMP, no way to cast to my class
          Tom Mahaffey Newbie

          I haven't used blob/clob fields much in the past. But one thing you might be able to do is step in during the ejbLoad() and ejbStore() callback methods. This way, you can handle the large fields and byte arrays.

          If you have the 3rd edition O'Reilly book on EJB (the wallaby book), see page 298: Using ejbLoad() and ejbStore() in Container-Managed Persistence.

          Good luck.

          • 2. Re: Object in CMP, no way to cast to my class
            Erik Nord Newbie

            I am running into this same issue. Did you ever find a resolution for this problem? I am currently using Jboss 2.4.4 and DB2 7.2 with fixpak 5. I have also noticed that as long as you let Jboss persist the original object you can still see the object correctly through the Entity Bean. I gets all screwed up once I cycle Jboss and try to see the object.

            Thanks for your assistance
            Erik Nord