[jboss-user] [JBoss Seam] - Re: Using stateless beans generated by seam in standalone Ja

JbossDing do-not-reply at jboss.com
Fri Jul 13 00:17:28 EDT 2007


Thanks for the reply and code example. But I thought the code generated by seam-gen is not ejb (please refer to my above first message). I am very shallow on seam so far. When I follow the seam tutorial of the Registration example, everything is making sense, like you will code the session bean with annotation @stateless and entity bean with @entity. What's more, there is a ejb-jar.xml for deployment descriptor and each bean has remote methods that client can call, for example method register().

However, if you look closely at the generated code as I posted above, for table host, seam-gen generated 2 java files in src/Action folder, which I think should be where session beans are. They HostHome.java and HostList.java. By looking at those code closely, they do not have annotation @stateless or @entity. What is more, I do not know what remote methods will execute CRUD operations. For example, in HostHome.java, it has setHostId, getHostId, isWired, wire, getDefinedInstance. If I need to update the records, what remote method to call?

I am not very familiar with JPA. I thought the code you put in the last message is for client to use JPA to query database.  That is terrific. However, because seam-gen generated data-access layer codes like session bean and entity beans, I would like to be lazy and use the generated codes in client directly.

After a little reading of seam, it occurs to me that seam-gen generated data-access code in src/Action folder is not suitable for direct call from a standalone java application. Please correct me if I am wrong. I really need some jboss seam guru to tell me if there is a way for standalone java client (replacing jsf) to reuse seam-gen generated data-access codes. seam-gen is great, but it's just too mysterious for me to us in a not so usual way.

Thanks for your attention nd help



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

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



More information about the jboss-user mailing list