• Post Reply Bookmark Topic Watch Topic
  • New Topic

CMP Beans  RSS feed

 
Aftab Hussain
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm creating a workflow engine using JBoss 2.4.4 and Oracle 8i. I have created CMP beans for my workflow entities like Workflow, WorkflowEventType, etc. Lets say my primary key fields on entity WorkflowEventType are WorkflowCode and EventCode. But in my code I want to find by workflowcode and eventname(instead of eventcode). How should I do this with CMP?? My EJB book says this is vendor specfic for each App server. But does explain how it is done. With BMP this would be straightforward..you just write JDBC code for each finder.
 
Thomas Paul
mister krabs
Ranch Hand
Posts: 13974
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please note that javaRanch has a naming standard that you must follow (it was prominently displayed when you registered). You must use your real first name - space -real last name as your display name. You will not be eligible for the book give-away unless you follow this standard. Thanks.
 
Tim Holloway
Bartender
Posts: 18715
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's typically an auxilliary file that holds the finder information and it's very appserver-specific (until EJB 2.0, anyway). For example, WebLogic finder arguments are in a LISP-like language, but JOnAS finder arguments are an SQL WHERE clause.
I never got into JBoss enough to know for sure what they use, but it should be in the JBoss docs.
 
Matjaz Juric
Author
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Aftab:
But in my code I want to find by workflowcode and eventname(instead of eventcode). How should I do this with CMP?? My EJB book says this is vendor specfic for each App server. But does explain how it is done. With BMP this would be straightforward..you just write JDBC code for each finder.

As far as I know, JBoss is EJB 2.0 compliant. That means that you can use CMP 2.0 with EJB QL, so you can place queries in the deployment descriptor.
 
Phil Sharp
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Aftab
Oddly enough just been looking at how to do finders.
Basically you need to put the finder 'SQL' in the jaws.xml, the jBoss specific descriptor file.
Following reference explains how to do it:
http://www.jboss.org/online-manual/HTML/ch06s07.html
Looking at version 2.4.4, it appears it is only 1.1 compliant with some bits of 2.0 such as message driven beans. I think you will need to wait until JBoss version 3 to get full 2.0 compliance.
However I'm just starting on JBoss. Anybody knows better please tell me.
Phil
 
Aftab Hussain
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry Thomas...I have now updated my profile with full name.
I would prefer to use EJB QL, but I think Phil is right. I don't think my current version of jBoss support EJB QL. (I will try it). jBoss 3.0 is EJB 2 compliant. Thanks for link to jBoss site.
Thanks for all the help guys,
Aftab
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!