Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright (C) 2012 Clarion Media, LLC
   * 
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
   *
   *     http://www.apache.org/licenses/LICENSE-2.0
   *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 
 package com.clarionmedia.infinitum.orm.criteria;
 
 import java.util.List;
 
 

This interface represents a query for a particular persistent class. Criteria queries consist of com.clarionmedia.infinitum.orm.criteria.criterion.Criterion, which act as restrictions on a query.

Author(s):
Tyler Treat
Version:
1.0 02/17/12
Since:
1.0
 
 public interface Criteria<T> {

Returns the Criteria query in SQL form.

Returns:
SQL java.lang.String for this Criteria
 
 	String toSql();

Returns the java.lang.Class associated with this Criteria.

Returns:
Criteria entity Class
 
Returns the java.util.List of com.clarionmedia.infinitum.orm.criteria.criterion.Criterion for this Criteria.

Returns:
List of Criterion
 
Returns the result set limit for this Criteria.

Returns:
result set limit
 
 	int getLimit();

Returns the offset value for this Criteria.

Returns:
offset value
 
 	int getOffset();

Returns the com.clarionmedia.infinitum.orm.ObjectMapper associated with this Criteria.

Returns:
ObjectMapper
 
Adds a com.clarionmedia.infinitum.orm.criteria.criterion.Criterion to filter retrieved query results.

Parameters:
criterion the Criterion to apply to the Criteria query
Returns:
this Criteria to allow for method chaining
 
 	Criteria<T> add(Criterion criterion);

Limits the number of query results.

Parameters:
limit max number of entities to retrieve
Returns:
this Criteria to allow for method chaining
 
 	Criteria<T> limit(int limit);

Offsets the result set by the given amount.

Parameters:
offset amount to offset results
Returns:
this Criteria to allow for method chaining
	Criteria<T> offset(int offset);

Retrieves the query results as a java.util.List.

Returns:
query results in List form
	List<T> list();

Retrieves a unique query result for the Criteria query.

Returns:
unique query result or null if no such result exists
Throws:
com.clarionmedia.infinitum.exception.InfinitumRuntimeException if there was not a unique result for the query
Retrieves the number of results for the Criteria query.

Returns:
number of results for the query
	long count();

Retrieves the database android.database.Cursor for the Criteria query.

Returns:
query Cursor
Retrieves the com.clarionmedia.infinitum.orm.Session this Criteria is attached to.

Returns:
Criteria Session
New to GrepCode? Check out our FAQ X