I am calling up some entity beans via a 1..n relationship method on my parent entity 
bean, and I notice that the SQL that JBoss CMP generates in the logging is 
surprisingly 1 SQL per field.  

For instance, I have this output from JDBCLoadEntityCommand:

SELECT question_option_id, answer_id FROM answer WHERE (question_option_id=?) OR 
(question_option_id=?) OR (question_option_id=?)
  | SELECT question_option_id, owner_id FROM question_option WHERE 
(question_option_id=?) OR (question_option_id=?) OR (question_option_id=?)
  | SELECT question_option_id, question_option_text FROM question_option WHERE 
(question_option_id=?) OR (question_option_id=?) OR (question_option_id=?)
  | SELECT question_option_id, question_type_id FROM question_option WHERE 
(question_option_id=?) OR (question_option_id=?) OR (question_option_id=?)
  | SELECT question_option_id, position FROM question_option WHERE 
(question_option_id=?) OR (question_option_id=?) OR (question_option_id=?)
  | SELECT question_option_id, total_answers FROM question_option WHERE 
(question_option_id=?) OR (question_option_id=?) OR (question_option_id=?)
  | SELECT question_option_id, date_created FROM question_option WHERE 
(question_option_id=?) OR (question_option_id=?) OR (question_option_id=?)
  | SELECT question_option_id, date_modified FROM question_option WHERE 
(question_option_id=?) OR (question_option_id=?) OR (question_option_id=?)
  | 

Can I configure my entity beans or JBoss somehow to call up the question_option 
dataset in one SQL, for efficiency? Have I configured something wrong?

The entity declaration in jbosscmp-jdbc.xml is basic - just ejb-name, table-name and 
cmp-fields. I suspect the ejb-relation declaration, because it comes out of xdoclet 
and I'm not sure about it:

    <ejb-relation>
  |       <ejb-relation-name>Question-Options</ejb-relation-name>
  | 
  |       <foreign-key-mapping/>
  | 
  |       <ejb-relationship-role>
  |           
<ejb-relationship-role-name>Question-Has-Options</ejb-relationship-role-name>
  |           <key-fields>
  |              <key-field>
  |                <field-name>questionId</field-name>
  |                <column-name>question_id</column-name>
  |              </key-field>
  |           </key-fields>
  | 
  |       </ejb-relationship-role>
  |       <ejb-relationship-role>
  |           
<ejb-relationship-role-name>Options-belong-to-Question</ejb-relationship-role-name>
  |               <key-fields/>
  | 
  |       </ejb-relationship-role>
  |     </ejb-relation>
  | 

Thanks,
Adam

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

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


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to