0 Replies Latest reply on Oct 21, 2010 7:29 AM by benpage1

    Complex model-driven filters




      I'm working on an application using the model-driven LCDS tools. The initial proof of concept has been fairly successful but I'm running into problems trying to customise the java assemblers which are generated from the model.


      For certain entities I need to filter the "fill" results based on the authenticated user's permissions and a few other tables. For various reasons the logic required to perform this filtering is rather complex and can't be carried out using JPQL. As far as I know there is no way to do the equivalent of a hibernate "named query" which seems to leave me with three options:


      1. Customise the assembler (derived from FiberAssembler) and query the database myself from within the "fill" method. I haven't found any examples which override the fill method, I've tried it myself but have had difficulty correctly constructing the final object graph (particularly the lazy loaded properties)
      2. Filter the objects in the derived assembler after they have been returned by the base FiberAssembler. I'd rather not have to do this, also the returned objects are of a generated type which makes them hard to work with.
      3. Scrap the model driven approach and start again using HibernateAssemblers (I could do what I need using a named query)


      Can anyone provide any advice or examples of overriding the FiberAssembler "fill" method for this sort of complex filtering?