From: <fg...@us...> - 2009-02-23 12:48:08
|
Revision: 1061 http://openutils.svn.sourceforge.net/openutils/?rev=1061&view=rev Author: fgrilli Date: 2009-02-23 12:48:05 +0000 (Mon, 23 Feb 2009) Log Message: ----------- improved doc Modified Paths: -------------- trunk/openutils-mgnlcriteria/src/site/apt/index.apt Modified: trunk/openutils-mgnlcriteria/src/site/apt/index.apt =================================================================== --- trunk/openutils-mgnlcriteria/src/site/apt/index.apt 2009-02-22 20:27:29 UTC (rev 1060) +++ trunk/openutils-mgnlcriteria/src/site/apt/index.apt 2009-02-23 12:48:05 UTC (rev 1061) @@ -21,7 +21,7 @@ People already familiar with Hibernate's Criteria will find almost no difference (type names and methods have been kept the same on purpose, whenever possible): you create a <<<Criteria>>> object with one of the static methods in <<<JCRCriteriaFactory>>> and start adding <<<Restrictions>>> and a final optional <<<Order>>>. - Then you call the <<<list()>>> method to get your <<<Collection>>> of results (basically instances of <<<info.magnolia.cms.core.Content>>>). As in Hibernate's Criteria, method chaining is supported. + Then you call the <<<list()>>> method to get your <<<Collection>>> of results (that is instances of <<<info.magnolia.cms.core.Content>>>). As in Hibernate's Criteria, method chaining is supported. Here is an example: +----------------------------------------------+ @@ -30,7 +30,7 @@ Calendar end = Calendar.getInstance(); end.set(2008, 11, 1); - Collection pets = JCRCriteriaFactory.createMgnlCriteria("//dogs//*", MgnlContext.getQueryManager("website"), "mgnl:content").add( + Collection<Content> pets = JCRCriteriaFactory.createMgnlCriteria("//dogs//*", MgnlContext.getQueryManager("website"), "mgnl:content").add( Restrictions.contains("@name", "Nana")).add( Restrictions.gt("@weight", new Float(10))).add( Restrictions.between("@birthDate", begin, end).addOrder( This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |