|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.amazon.carbonado.qe.AbstractQuery<S>
com.amazon.carbonado.qe.EmptyQuery<S>
public final class EmptyQuery<S extends Storable>
Special query implementation that fetches nothing.
| Constructor Summary | |
|---|---|
EmptyQuery(QueryFactory<S> factory,
OrderingList<S> ordering)
|
|
EmptyQuery(QueryFactory<S> factory,
String... orderings)
|
|
EmptyQuery(QueryFactory<S> factory,
String ordering)
|
|
| Method Summary | ||
|---|---|---|
|
after(T start)
Returns a query which fetches results for this query after a given starting point, which is useful for re-opening a cursor. |
|
Query<S> |
and(Filter<S> filter)
Always throws an IllegalStateException. |
|
void |
appendTo(Appendable app)
Append the string representation of this object to the given Appendable. |
|
long |
count()
Always returns zero. |
|
void |
deleteAll()
Does nothing. |
|
void |
deleteOne()
Always throws PersistNoneException. |
|
boolean |
equals(Object obj)
|
|
boolean |
exists()
Always returns false. |
|
Cursor<S> |
fetch()
Always returns an EmptyCursor. |
|
Cursor<S> |
fetchSlice(long from,
Long to)
Always returns an EmptyCursor. |
|
int |
getBlankParameterCount()
Always returns zero. |
|
Filter<S> |
getFilter()
Always returns a ClosedFilter. |
|
FilterValues<S> |
getFilterValues()
Always returns null. |
|
Class<S> |
getStorableType()
Returns the specific type of Storable managed by this object. |
|
int |
hashCode()
|
|
Query<S> |
not()
Returns a query that fetches everything, possibly in a specified order. |
|
Query<S> |
or(Filter<S> filter)
Returns a new query which has another filter logically "or"ed to this, potentially increasing the amount of
results. |
|
Query<S> |
orderBy(String... properties)
Returns a copy of this query ordered by specific property values. |
|
Query<S> |
orderBy(String property)
Returns a copy of this query ordered by a specific property value. |
|
boolean |
printNative(Appendable app,
int indentLevel)
Always returns false. |
|
boolean |
printPlan(Appendable app,
int indentLevel)
Always returns false. |
|
boolean |
tryDeleteOne()
Always returns false. |
|
Query<S> |
with(boolean value)
Always throws an IllegalStateException. |
|
Query<S> |
with(byte value)
Always throws an IllegalStateException. |
|
Query<S> |
with(char value)
Always throws an IllegalStateException. |
|
Query<S> |
with(double value)
Always throws an IllegalStateException. |
|
Query<S> |
with(float value)
Always throws an IllegalStateException. |
|
Query<S> |
with(int value)
Always throws an IllegalStateException. |
|
Query<S> |
with(long value)
Always throws an IllegalStateException. |
|
Query<S> |
with(Object value)
Always throws an IllegalStateException. |
|
Query<S> |
with(short value)
Always throws an IllegalStateException. |
|
Query<S> |
withValues(Object... values)
Throws an IllegalStateException unless no values passed in. |
|
| Methods inherited from class com.amazon.carbonado.qe.AbstractQuery |
|---|
and, checkSliceArguments, fetchAfter, loadOne, or, printNative, printNative, printPlan, printPlan, toString, tryLoadOne |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public EmptyQuery(QueryFactory<S> factory,
OrderingList<S> ordering)
factory - required query factory, used by 'or' and 'not' methodsordering - optional order-by properties
public EmptyQuery(QueryFactory<S> factory,
String ordering)
factory - required query factory, used by 'or' and 'not' methodsordering - optional order-by property
public EmptyQuery(QueryFactory<S> factory,
String... orderings)
factory - required query factory, used by 'or' and 'not' methodsorderings - optional order-by properties| Method Detail |
|---|
public Class<S> getStorableType()
Query
public Filter<S> getFilter()
ClosedFilter.
public FilterValues<S> getFilterValues()
public int getBlankParameterCount()
public Query<S> with(int value)
value - parameter value to fill inpublic Query<S> with(long value)
value - parameter value to fill inpublic Query<S> with(float value)
value - parameter value to fill inpublic Query<S> with(double value)
value - parameter value to fill inpublic Query<S> with(boolean value)
value - parameter value to fill inpublic Query<S> with(char value)
value - parameter value to fill inpublic Query<S> with(byte value)
value - parameter value to fill inpublic Query<S> with(short value)
value - parameter value to fill inpublic Query<S> with(Object value)
value - parameter value to fill inpublic Query<S> withValues(Object... values)
values - parameter values to fill in; if null or empty, this
Query instance is returnedpublic Query<S> and(Filter<S> filter)
filter - query filter
public Query<S> or(Filter<S> filter)
throws FetchException
Queryfilter logically "or"ed to this, potentially increasing the amount of
results.
filter - query filter
FetchException - if storage layer throws an exception
public Query<S> not()
throws FetchException
FetchException - if storage layer throws an exception
public Query<S> orderBy(String property)
throws FetchException
QueryNote: Specification of ordering properties is not cumulative. Calling this method will first remove any previous ordering properties.
property - name of property to order by
FetchException - if storage layer throws an exception
public Query<S> orderBy(String... properties)
throws FetchException
QueryNote: Specification of ordering properties is not cumulative. Calling this method will first remove any previous ordering properties.
properties - names of properties to order by
FetchException - if storage layer throws an exceptionpublic <T extends S> Query<S> after(T start)
Queryordering. If not a total ordering, then query may start at an earlier
position.
Note: The returned query can be very expensive to fetch from repeatedly, if the query needs to perform a sort operation. Ideally, the query ordering should match the natural ordering of an index or key.
start - storable to attempt to start after; if null, this query is
returnedpublic Cursor<S> fetch()
EmptyCursor.
Repository.enterTransaction(IsolationLevel)
public Cursor<S> fetchSlice(long from,
Long to)
EmptyCursor.
from - zero-based from record number, inclusiveto - optional zero-based to record number, exclusive
public void deleteOne()
throws PersistNoneException
PersistNoneException.
deleteOne in interface Query<S extends Storable>deleteOne in class AbstractQuery<S extends Storable>PersistNoneException - if no matching record foundpublic boolean tryDeleteOne()
public void deleteAll()
public long count()
public boolean exists()
public void appendTo(Appendable app)
throws IOException
Appender
app - Appendable object to receive string representation
IOException - if thrown from given Appendable
public boolean printNative(Appendable app,
int indentLevel)
app - append results hereindentLevel - amount to indent text, zero for none
public boolean printPlan(Appendable app,
int indentLevel)
app - append results hereindentLevel - amount to indent text, zero for none
public int hashCode()
hashCode in interface Query<S extends Storable>hashCode in class AbstractQuery<S extends Storable>public boolean equals(Object obj)
equals in interface Query<S extends Storable>equals in class AbstractQuery<S extends Storable>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||