3 Replies Latest reply on May 17, 2007 12:13 PM by bulloncito

    Injecting properties using CRUD framework

    pdhaigh

      Hi,

      I am working with the CRUD framework, with everything configured in components.xml.

      What I'm trying to add is the concept of last_updated_by - this is just a string that will be equal to #{identity.username}

      I can do this fine for a new object:

       <factory name="vacancy" value="#{vacancyDAO.instance}" />
       <fwk:entity-home name="vacancyDAO"
       entity-class="com.example.model.Vacancy"
       new-instance="#{newVacancy}"/>
      


       <component name="newVacancy" class="com.example.model.Vacancy">
       <property name="last_updated_by">#{identity.username}</property>
       <property name="created_by">#{identity.username}</property>
       </component>
      


      However, without extending entity-home and making a real class for the component, I'm at a bit of a loss of how to insert that #{identity.username} property to an existing object when calling vacancy.update.

      Is there a way to do this? (I don't believe you can inject a property direct to a POJO Entity?)

      cheers

      phil