[jboss-user] [JBoss Seam] - Injecting properties using CRUD framework

pdhaigh do-not-reply at jboss.com
Wed May 16 16:47:45 EDT 2007


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

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4046304#4046304

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4046304



More information about the jboss-user mailing list