1 2 Previous Next 18 Replies Latest reply on Sep 25, 2007 1:24 PM by mustaghattack Go to original post
      • 15. Re: Further extending an EntityHome
        mustaghattack

         


        Seam instantiates (javabean) components with a no-arg constructor, so this won't help, unless you yourself instantiate an entityHome using "new", which you shouldn't ever be doing.

        Of course. But I didn't think it in that way ... You mainly use EntityHome with inheritance so instead of :
        class PersonHome extends EntityHome< Person > {
        ...
        }
        


        have

        class PersonHome extends EntityHome< Person > {
         public PersonHome() {
         super( Person.class );
         }
        ...
        }
        


        • 16. Re: Further extending an EntityHome
          damianharvey

           

          "damianharvey" wrote:
          ...only updatedMessage(), deletedMessage() and createdMessage() refer to entityClass rather than getEntityClass.

          ...oh, and createInstance()

          • 17. Re: Further extending an EntityHome
            matt.drees

             

            "mustaghattack" wrote:

            Of course. But I didn't think it in that way ... You mainly use EntityHome with inheritance so instead of :
            class PersonHome extends EntityHome< Person > {
            ...
            }
            


            have

            class PersonHome extends EntityHome< Person > {
             public PersonHome() {
             super( Person.class );
             }
            



            Ah, ok, gotcha. My bad.

            However, I don't think you'd need to modify EntityHome to get that kind of behavior. You could do
            class PersonHome extends EntityHome< Person > {
             public PersonHome() {
             setEntityClass(Person.class);
             }
            

            right?

            • 18. Re: Further extending an EntityHome
              mustaghattack

               

              "matt.drees" wrote:
              right?

              Right :) It's just a matter of design ...
              ( To me it would have been better to just remove the reflection stuff and change the no-arg constructor to a parameterized one )

              1 2 Previous Next