2 Replies Latest reply on Feb 4, 2003 2:32 AM by Jochen Cordes

    value-object and ejb:finder?

    darren hartford Expert

      Hi All,
      I get value-objects and how they improve efficiency. I get finders as the standard way of ejb-ql to query. But, I'm unsure how to create an efficient finder that will only return the necessary data for my lite value-objects...any ideas?

      Using xDoclet 1.2b2.

      Thanks in advance!

        • 1. Re: value-object and ejb:finder?
          darren hartford Expert

          Having a finder/ejbselect optionally return a Value-Object instead of the local (entity object) would make integration with Struts much simpler, smoother, and easier.

          However, in thinking ahead I'm not sure if extending the finder to return value-objects would be best - would value-objects be able to take advantage of an entity cache for performance.....comments?

          • 2. Re: value-object and ejb:finder?
            Jochen Cordes Novice

            Hi !

            How would you achieve to extend the finder, as it can only return references to the entity the query is bound to (or some field of it) ? Only ejbSelect can return other objects !

            That's how I do it: Create a session-facade, then execute the query, construct the value-object inside the entity (as per business-method), return the result. If your using the right commit-option (A) this benefits from the entity-cache, otherwise each finder-method goes straight to the database ...

            These are only my thoughts, then ;-)

            Bye,

            Jochen.