MCPcopy Create free account
hub / github.com/casidiablo/persistence / RawQuery

Interface RawQuery

src/main/java/com/codeslap/persistence/RawQuery.java:27–101  ·  view source on GitHub ↗

Methods in this interface will work like the findAll methods in the SqlAdapter interface, but instead of returning a java.util.List of beans it will return a cursor. @author cristian

Source from the content-addressed store, hash-verified

25 * @author cristian
26 */
27public interface RawQuery {
28 /**
29 * Retrieves all elements from the database of the specified type
30 *
31 * @param theClass the class of the object that we want to retrieve
32 * @return a Cursor pointing to the filter rows
33 */
34 Cursor findAll(Class<?> theClass);
35
36 /**
37 * Retrieves all elements from the database that matches the specified sample
38 *
39 * @param where sample object
40 * @return a Cursor pointing to the filter rows
41 */
42 Cursor findAll(Object where);
43
44 /**
45 * Retrieves all elements from the database that matches the specified sample. And follows the specified constraint.
46 *
47 * @param where sample object
48 * @param constraint constrains for this query
49 * @return a Cursor pointing to the filter rows
50 */
51 Cursor findAll(Object where, Constraint constraint);
52
53 /**
54 * Retrieves all elements from the database that are attached to the specified object
55 *
56 * @param where the sample object
57 * @param attachedTo the object that is attached to the sample object
58 * @return a Cursor pointing to the filter rows
59 */
60 Cursor findAll(Object where, Object attachedTo);
61
62 /**
63 * Retrieves all elements from the database that matches the specified sample
64 *
65 * @param theClass the class to find all items
66 * @param where a SQL query. It is recommended to use wildcards like: <code>something = ? AND another = ?</code>
67 * @param whereArgs the list of values used in the wildcards
68 * @return a Cursor pointing to the filter rows
69 */
70 Cursor findAll(Class<?> theClass, String where, String[] whereArgs);
71
72 /**
73 * @param rawQuery an SQL query to execute
74 * @return A Cursor object, which is positioned before the first entry. Note that Cursors are not synchronized,
75 * see the documentation for more details.
76 */
77 Cursor rawQuery(String rawQuery);
78
79 /**
80 * @param table The table name to compile the query against.
81 * @param projection A list of which columns to return. Passing null will return all columns, which is
82 * discouraged to prevent reading data from storage that isn't going to be used.
83 * @param selection A filter declaring which rows to return, formatted as an SQL WHERE clause (excluding the
84 * WHERE itself). Passing null will return all rows for the given table.

Callers 12

findAllByClassTestMethod · 0.95
findAllBySampleMethod · 0.95
findAllByQueryMethod · 0.95
testAttachedToMethod · 0.95
testConstraintsMethod · 0.65
testSingleInsertionMethod · 0.65
performTestingMethod · 0.65
findAllByQueryMethod · 0.95
onUpgradeDatabaseMethod · 0.65
getBeanFromCursorMethod · 0.65
rawQueryMethod · 0.65

Implementers 1

RawQueryImplsrc/main/java/com/codeslap/persistence

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…