Author: epbernard
Date: 2007-09-23 16:18:24 -0400 (Sun, 23 Sep 2007)
New Revision: 14022
Modified:
search/trunk/src/test/org/hibernate/search/test/session/SessionTest.java
Log:
Test detached criteria
Modified: search/trunk/src/test/org/hibernate/search/test/session/SessionTest.java
===================================================================
--- search/trunk/src/test/org/hibernate/search/test/session/SessionTest.java 2007-09-23
20:17:51 UTC (rev 14021)
+++ search/trunk/src/test/org/hibernate/search/test/session/SessionTest.java 2007-09-23
20:18:24 UTC (rev 14022)
@@ -2,11 +2,14 @@
package org.hibernate.search.test.session;
import java.lang.reflect.Proxy;
+import java.util.List;
import org.hibernate.search.test.SearchTestCase;
import org.hibernate.search.Search;
import org.hibernate.search.FullTextSession;
import org.hibernate.Session;
+import org.hibernate.Criteria;
+import org.hibernate.criterion.DetachedCriteria;
/**
* @author Emmanuel Bernard
@@ -38,6 +41,20 @@
wrapped.close();
}
+ public void testDetachedCriteria() throws Exception {
+ FullTextSession s = Search.createFullTextSession( openSession( ) );
+ DetachedCriteria dc = DetachedCriteria.forClass( Email.class );
+ try {
+ Criteria c = dc.getExecutableCriteria( s ).setMaxResults( 10 );
+ List results = c.list();
+ }
+ catch( ClassCastException e ) {
+ e.printStackTrace( );
+ fail(e.toString());
+ }
+ s.close();
+ }
+
protected Class[] getMappings() {
return new Class[] {
Email.class
Show replies by date