1 Reply Latest reply on Apr 23, 2002 11:36 AM by dsundstrom

    Relation to abstract entity beans

    erikture

      Hello!

      I am using the latest JBoss from CVS.

      I wold like to implement a FileManager function.
      Is it possible to have relations between an entity bean and an abstract entity bean?

      What I would like to do is the following:
      I have on entity bean, lets call it Folder.
      Then I have one abstract entity bean, lets call it File.
      The File entity bean is subclassed into several entity beans, for example WordFile, TextFile and ImageFile.

      Now I whant to have a relation between the Folder bean and the File bean. I whant the Folder to know about all the File beans that are related to it, but the Folder bean does not know about all the subclasses of the File bean.
      Is this possible?
      How do I specify it in ejb-jar.xml?
      Do I have to specify more than one relation, one for each subclass?

      Can you "instansiate" the File entity bean from the Folder bean to get the common information located in the File bean.

      /Erik Turesson

        • 1. Re: Relation to abstract entity beans
          dsundstrom

          No you can't do exactally what you want, but if you are willing to be flexible you should be able to modle this.

          I suggest you create a FileManager entity and a File entity in a one-to-many bi-directional relationship. Then create the WordFile, TextFile and ImageFile entities which are in a one-to-one uni-directional relationship. This basically the type specific info into a decorator [Gamma et. al.].