[jboss-user] [JBoss Seam] - Home Entity not Working

bulloncito do-not-reply at jboss.com
Mon Feb 19 21:29:59 EST 2007


... finally managed to use EntitiHome in my project, however this code works:

<factory name="user" 
  | 		 value="#{userHome.instance}"/>
  | 
  | <framework:entity-home name="userHome" 
  | 	entity-class="myPackage.User"
  | 	entity-manager="#{entityManager}" />

while this one does not:

@Name("userHome")
  | @Scope(ScopeType.CONVERSATION)
  | public class UserHome extends EntityHome<User> {
  | 
  | 	@In EntityManager entityManager ;
  | 
  | 	@RequestParameter Long userId ;
  | 
  | 	@Factory("user")
  | 	public User initUser() { return getInstance() ; }
  | 
  | 	@End
  | 	public String persist() {
  | 		super.persist() ;
  | 		return "users" ;
  | 	}
  | 	
  | 	@End
  | 	public String update() {
  | 		setId( userId ) ;
  | 		super.update() ;
  | 		return "users" ;
  | 	}
  | 	
  | 	@End
  | 	public String remove() {
  | 		setId( userId ) ;
  | 		super.remove() ;
  | 		return "users" ;
  | 	}
  | 
  | 	@Destroy @Remove
  | 	public void destroy() {}
  | 
  | }

... everything else is the same.

... is this a bug ? or am I missing something ? I believe it's better to use inheritance to add some extra features by hand, but I can't  :(

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

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



More information about the jboss-user mailing list