|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.info.QueryOptions
public class QueryOptions
This class holds information to configure itemqueries in webservices with. It is which items to include in the query and which restriction to put on the query.
The includes in this class correspond
directly to the includes in
Include
.
The include options will be set to TRUE if nothing
else is specified.
Field Summary | |
---|---|
private boolean |
includeInProject
Include items from the active project. |
private boolean |
includeMine
Include items that belongs to the logged in user. |
private boolean |
includeNotRemoved
|
private boolean |
includeOthers
Include items that belong to other users. |
private boolean |
includeShared
Include items, shared to the logged in user. |
private QueryParameter[] |
parameters
|
private String |
prefix
The prefix that represent a root alias in a query. |
private String |
restriction
A restriction to set on the query. |
Constructor Summary | |
---|---|
QueryOptions()
An empty constructor. |
|
QueryOptions(Boolean includeMine,
Boolean includeShared,
Boolean includeInProject,
Boolean includeOthers,
String restriction,
String prefix)
Constructor where the parameters is set from start. |
Method Summary | |
---|---|
boolean |
getIncludeInProject()
Gets if items in the project that is currently active should be included. |
boolean |
getIncludeMine()
Gets if items of logged in user should be included |
boolean |
getIncludeNotRemoved()
Include not removed items |
boolean |
getIncludeOthers()
Gets if other users' item should be included in the query |
boolean |
getIncludeShared()
Gets if items shared to the logged in user should be included or not |
QueryParameter[] |
getParameters()
Get the parameters used in this query. |
String |
getRestriction()
Gets the restriction for this QueryOptions |
String |
getRestrictionPrefix()
Gets the prefix used with the restriction/expression in this object. |
void |
setIncludeInProject(boolean includeInProject)
Sets if items in currently active project should be included. |
void |
setIncludeMine(boolean includeMine)
Sets if the logged in user's items should be included or not. |
void |
setIncludeNotRemoved(boolean include)
Sets if not removed items should be included |
void |
setIncludeOthers(boolean includeOthers)
Sets if other users' items should be included. |
void |
setIncludeShared(boolean includeShared)
Sets if items shared to logged in user should be included. |
void |
setParameters(QueryParameter[] parameters)
Set the parmeters to use in this query. |
void |
setRestriction(String restriction)
Sets restriction for these query options. |
void |
setRestrictionPrefix(String prefix)
Sets the prefix to use in restrictions or expression |
void |
setRestrictionWithPrefix(String restriction,
String prefix)
Sets both the restriction and the prefix with it. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private boolean includeMine
private boolean includeShared
private boolean includeInProject
private boolean includeOthers
private boolean includeNotRemoved
private QueryParameter[] parameters
private String restriction
private String prefix
restriction
and will be replaced when the restriction is
inserted into a HQL query.
Constructor Detail |
---|
public QueryOptions()
public QueryOptions(Boolean includeMine, Boolean includeShared, Boolean includeInProject, Boolean includeOthers, String restriction, String prefix)
includeMine
- TRUE if logged in user's items should be included.includeShared
- TRUE if items shared to logged in user should be included.includeInProject
- TRUE if items in the active project should be included.includeOthers
- TRUE if other users' items should be included.restriction
- A Restriction
as a string.prefix
- Prefix used in the restriction.Method Detail |
---|
public void setIncludeMine(boolean includeMine)
includeMine
- TRUE to include logged in user's items, otherwise FALSEpublic boolean getIncludeMine()
public void setIncludeShared(boolean includeShared)
includeShared
- TRUE to include shared items, otherwise FALSE.public boolean getIncludeShared()
public void setIncludeInProject(boolean includeInProject)
includeInProject
- TRUE to include, FALSE otherwise.public boolean getIncludeInProject()
public void setIncludeOthers(boolean includeOthers)
includeOthers
- TRUE if the item should be included, FALSE otherwise.public boolean getIncludeOthers()
public void setIncludeNotRemoved(boolean include)
include
- TRUE(default) to include.public boolean getIncludeNotRemoved()
public void setRestriction(String restriction)
The string must be in right format so it can be inserted
directly into a hql query. The restriction string
can contain a prefix, but it has to be set separatly
setRestrictionPrefix(String)
.
Example how this property can be used together with the prefix:
$name='item1'
When this string is used in a query, ie that select users, it will look like this:
usr.name='item1'.
restriction
- A restriction as a string to use with HQL queries.public String getRestriction()
public void setRestrictionPrefix(String prefix)
prefix
- A prefix where the root-alias should be put.public String getRestrictionPrefix()
public void setRestrictionWithPrefix(String restriction, String prefix)
restriction
- A string with a valid hql restriction.prefix
- A string that is used where root-alias should be put in
the restriction/expression.public QueryParameter[] getParameters()
public void setParameters(QueryParameter[] parameters)
parameters
- An array of query parameters, may be null or empty
if not parameters are used
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |