You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-dev@db.apache.org by br...@apache.org on 2004/05/01 17:17:46 UTC

cvs commit: db-ojb/xdocs query.xml

brj         2004/05/01 08:17:46

  Modified:    forrest/src/documentation/content/xdocs/docu query.xml
               xdocs    query.xml
  Log:
  added docu for Criteria#addPathClass
  
  Revision  Changes    Path
  1.3       +31 -3     db-ojb/forrest/src/documentation/content/xdocs/docu/query.xml
  
  Index: query.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/forrest/src/documentation/content/xdocs/docu/query.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- query.xml	28 Apr 2004 08:03:52 -0000	1.2
  +++ query.xml	1 May 2004 15:17:45 -0000	1.3
  @@ -21,7 +21,7 @@
       <header>
           <title>OJB Queries</title>
           <authors>
  -            <person name="Jakob Braeuchi" email="jbraeuchi@hotmail.com"/>
  +            <person name="Jakob Braeuchi" email="jbraeuchi@gmx.ch"/>
           </authors>
       </header>
   
  @@ -516,6 +516,34 @@
               </section>
   
               <section>
  +                <title>class hints</title>
  +                <p>
  +                    This feature allows the user to specify which class of an extent to use for a path-segment. 
  +                    The standard behaviour of OJB is to use the base class of an extent when it resolves a path-segment.
  +                </p>
  +                <p>                
  +                    In the following sample the path <strong>allArticlesInGroup</strong> points to class Article, 
  +                    this is defined in the repository.xml. Assume we are only interested in CdArticles, a class hint can be
  +                    defined for the path. This hint is defined by: <br/><br/>
  +                    Criteria#<strong>addPathClass</strong>("allArticlesInGroup", CdArticle.class);
  +                </p>
  +                    
  +                    <source><![CDATA[
  +crit = new Criteria();
  +crit.addEqualTo("allArticlesInGroup.articleId", new Integer(cd.getArticleId()));
  +query = new QueryByCriteria(ProductGroup.class, crit);
  +crit.addPathClass("allArticlesInGroup", CdArticle.class);
  +broker.getObjectByQuery(query);
  +]]></source>
  +
  +                <note>
  +                    This feature is also available in class QueryByCriteria but using it on Criteria-level provides
  +                    additional flexibility. QueryByCriteria#addPathClass may be deprecated in the future.
  +				</note>
  +				
  +            </section>
  +
  +            <section>
                   <title>prefetched relationships</title>
                   <p>
                       This feature can help to minimize the number of queries when reading objects with relationships.
  @@ -630,4 +658,4 @@
               <title>JDO queries</title>
           </section>
       </body>
  -</document>
  +</document>
  \ No newline at end of file
  
  
  
  1.29      +31 -2     db-ojb/xdocs/query.xml
  
  Index: query.xml
  ===================================================================
  RCS file: /home/cvs/db-ojb/xdocs/query.xml,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- query.xml	5 Apr 2004 13:59:00 -0000	1.28
  +++ query.xml	1 May 2004 15:17:46 -0000	1.29
  @@ -18,7 +18,7 @@
   <document>
   
     <properties>
  -    <author email="jbraeuchi@hotmail.com">Jakob Braeuchi</author>
  +    <author email="jbraeuchi@gmx.ch">Jakob Braeuchi</author>
       <title>ObJectRelationalBridge Tutorial - Part 4</title>
     </properties>
   
  @@ -533,6 +533,35 @@
   </b>
   </subsection>
   
  +            <subsection name="class hints">
  +                <p>
  +                    This feature allows the user to specify which class of an extent to use for a path-segment. 
  +                    The standard behaviour of OJB is to use the base class of an extent when it resolves a path-segment.
  +                </p>
  +                <p>                
  +                    In the following sample the path <strong>allArticlesInGroup</strong> points to class Article, 
  +                    this is defined in the repository.xml. Assume we are only interested in CdArticles, a class hint can be
  +                    defined for the path. This hint is defined by: <br/><br/>
  +                    Criteria#<strong>addPathClass</strong>("allArticlesInGroup", CdArticle.class);
  +                </p>
  +                    
  +                    <source><![CDATA[
  +crit = new Criteria();
  +crit.addEqualTo("allArticlesInGroup.articleId", new Integer(cd.getArticleId()));
  +query = new QueryByCriteria(ProductGroup.class, crit);
  +crit.addPathClass("allArticlesInGroup", CdArticle.class);
  +broker.getObjectByQuery(query);
  +]]></source>
  +
  +
  +                <note>
  +                    This feature is also available in class QueryByCriteria but using it on Criteria-level provides
  +                    additional flexibility. QueryByCriteria#addPathClass may be deprecated in the future.
  +				</note>
  +				
  +            </subsection>
  +
  +
   <subsection name="prefetched relationships">
   <p>
   This feature can help to minimize the number of queries when reading objects with relationships.
  @@ -636,4 +665,4 @@
   </section>
   
   </body>
  -</document>
  +</document>
  \ No newline at end of file
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org