|
OBEROn SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.oberon.ooql.sdk.OBBase com.oberon.ooql.sdk.AdminBase com.oberon.ooql.sdk.Query
public class Query
Query: represents a User query for OBEROn ObjectObj
instances
Field Summary |
---|
Fields inherited from class com.oberon.ooql.sdk.AdminBase |
---|
bsOptions, HIDDEN_OPTION |
Constructor Summary | |
---|---|
Query()
|
|
Query(java.lang.String name)
Define a new Query to all users |
|
Query(java.lang.String name,
java.lang.String userName)
Define a new Query associated to a specific User |
Method Summary | |
---|---|
void |
addClassPattern(java.lang.String pattern)
Add a pattern to the ObjectObj 's Class name filter |
void |
addHolderPattern(java.lang.String pattern)
Add a pattern to the ObjectObj 's holder filter |
void |
addLifecyclePattern(java.lang.String pattern)
Add a pattern to the ObjectObj 's Lifecycle filter |
void |
addNamePattern(java.lang.String pattern)
Add a pattern to the ObjectObj 's name filter |
void |
addObjectSpacePattern(java.lang.String pattern)
Add a pattern to the ObjectSpace filter |
void |
addRevisionPattern(java.lang.String pattern)
Add a pattern to the ObjectObj 's revision filter |
void |
addStagePattern(java.lang.String pattern)
Add a pattern to the ObjectObj 's Stage filter |
java.lang.String |
compareUpdate(Query refQuery,
boolean checkImage,
boolean overwrite,
boolean force,
Framework framework)
Return/apply the OOQL command to update this Query object and let it become equals to another reference object. |
void |
count(Framework framework)
Execute the Query and count the result instance number |
void |
create(boolean overwrite,
boolean force,
Framework framework)
Create a new Query object on the database |
void |
create(Framework framework)
Create a new Query object on the database |
void |
destroy(Framework framework)
Remove the Query object from the database. |
void |
execute(java.io.DataOutputStream outStream,
Framework framework)
Execute the Query |
void |
execute(Selector selector,
java.io.DataOutputStream outStream,
Framework framework)
Execute the Query and extract the result ObjectObj instance properties |
void |
fromXML(org.jdom.Element rootElement)
Load the Query object from XML element tree |
java.util.Vector<java.lang.String> |
getClassPattern()
Get filters for the ObjectObj Class name |
java.lang.String |
getClassPatternAsString()
Get filters for the ObjectObj Class name as String (separated with ",") |
java.lang.String |
getCreateCommand(boolean force)
Return the OOQL command to create this Query object with the settled properties |
java.lang.String |
getCreateCommand(boolean force,
boolean overwrite)
Return the OOQL command to create this Query object with the settled properties |
java.lang.String |
getDescriptionPattern()
Get filter for the ObjectObj 's description |
java.lang.String |
getExecuteCommand()
Return the OOQL command to execute the Query ob the basis of settled filters |
java.lang.String |
getFilter()
Get OOQL filter expression for this Query |
java.util.Vector<java.lang.String> |
getHolderPattern()
Get filters for the ObjectObj holder |
java.lang.String |
getHolderPatternAsString()
Get filters for the ObjectObj holder as String (separated with ",") |
java.util.Vector<java.lang.String> |
getLifecyclePattern()
Get filters for the ObjectObj Lifecycle |
java.lang.String |
getLifecyclePatternAsString()
Get filters for the ObjectObj Lifecycle as String (separated with ",") |
int |
getMaxItems()
Get the maximum number of retrieved ObjectObj instances during the Query execution |
java.util.Vector<java.lang.String> |
getNamePattern()
Get filters for the ObjectObj name |
java.lang.String |
getNamePatternAsString()
Get filters for the ObjectObj name as String (separated with ",") |
java.util.Vector<java.lang.String> |
getObjectSpacePattern()
Get filters for the ObjectSpace |
java.lang.String |
getObjectSpacePatternAsString()
Get filters for the ObjectSpace as String (separated with ",") |
java.lang.String |
getProperty(java.lang.String propertyName,
java.util.Vector<java.lang.Object> filterArgs,
java.lang.String token,
Framework framework)
Get a property for this Query object by its OOQL identifier |
java.util.Vector<java.lang.String> |
getRevisionPattern()
Get filters for the ObjectObj revision |
java.lang.String |
getRevisionPatternAsString()
Get filters for the ObjectObj revision as String (separated with ",") |
java.lang.String |
getSaveCommand(boolean force)
Return the OOQL command to update this Query object with the modified properties. |
ObjectGroup |
getSaveGroup()
Get ObjectGroup where collect the Query result ObjectObj instances |
java.util.Vector<java.lang.String> |
getStagePattern()
Get filters for the ObjectObj Stage |
java.lang.String |
getStagePatternAsString()
Get filters for the ObjectObj Stage as String (separated with ",") |
java.util.Vector<?> |
getTargetNames(java.lang.String composedName,
java.util.Vector<java.lang.Object> filterArgs,
Framework framework)
Return a Vector of administrative object names extracted by using an OOQL selector |
java.lang.String |
getUser()
Get the User associated to this Query |
int |
getUserId()
Get the internal id of User associated to this Query |
java.util.Hashtable<java.lang.String,java.lang.String> |
getVariables()
Get the variable values for the Query execution |
boolean |
isGroupOverwrite()
Check if the ObjectGroup where collect the Query result ObjectObj instances can be updated |
void |
link(Framework framework,
java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
Open the Query object: connect the memory instance with the database instance |
static Query |
open(java.lang.String name,
Framework framework)
Open a general Query and read its properties from the database |
static Query |
open(java.lang.String name,
java.lang.String userName,
Framework framework)
Open a Query for a given user and read its properties from the database |
static Query |
open(java.lang.String name,
java.lang.String userName,
Framework framework,
java.util.Hashtable<java.lang.String,java.lang.Integer> counters)
Open a Query for a given user and read its properties from the database |
void |
resetClassPattern()
Remove filters for the ObjectObj Class name |
void |
resetHolderPattern()
Remove filters for the ObjectObj holder |
void |
resetLifecyclePattern()
Remove filters for the ObjectObj Lifecycle |
void |
resetNamePattern()
Remove filters for the ObjectObj name |
void |
resetObjectSpacePattern()
Remove filters for the ObjectSpace |
void |
resetRevisionPattern()
Remove filters for the ObjectObj revision |
void |
resetStagePattern()
Remove filters for the ObjectObj Stage |
void |
saveToGroup(java.lang.String objectgroup,
java.lang.String userName,
boolean overwrite)
Set the Query to collect resul ObjectObj instances into a user ObjectGroup |
void |
setClassPattern(java.util.Vector<java.lang.String> patterns)
Set filters for the ObjectObj Class name |
void |
setDescriptionPattern(java.lang.String pattern)
Set filter for the ObjectObj 's description |
void |
setFilter(java.lang.String expression)
Set OOQL filter expression for this Query |
void |
setHolderPattern(java.util.Vector<java.lang.String> patterns)
Set filters for the ObjectObj holder |
void |
setLifecyclePattern(java.util.Vector<java.lang.String> patterns)
Set filters for the ObjectObj Lifecycle |
void |
setMaxItems(int maxItems)
Set the maximum number of retrieved ObjectObj instances during the Query execution |
void |
setNamePattern(java.util.Vector<java.lang.String> patterns)
Set filters for the ObjectObj name |
void |
setObjectSpacePattern(java.util.Vector<java.lang.String> patterns)
Set filters for the ObjectSpace |
void |
setRevisionPattern(java.util.Vector<java.lang.String> patterns)
Set filters for the ObjectObj revision |
void |
setSelector(Selector selector)
Set the Query selector for ObjectObj instance properties |
void |
setStagePattern(java.util.Vector<java.lang.String> patterns)
Set filters for the ObjectObj Stage |
void |
setUser(java.lang.String userName)
Set the User associated to this Query |
void |
setUserId(int userID)
Set the internal id of User associated to this Query |
void |
setVariable(java.lang.String varName,
java.lang.String value)
Set a variable values for Query execution |
java.lang.String |
toString()
Return the Query object basic properties as a single String |
java.lang.String |
toString(Framework framework)
Return the Query object extended properties as a single String |
org.jdom.Element |
toXML(boolean getImage,
boolean fullDump,
Framework framework)
Return the Query object properties as XML element tree |
org.jdom.Element |
toXML(Framework framework)
Return the Query object properties as XML element tree |
void |
unlink(Framework framework)
Close the object: disconnect the memory instance from the database instance |
void |
write(boolean force,
Framework framework)
Update the Query object to the database |
void |
write(Framework framework)
Update the Query object to the database |
Methods inherited from class com.oberon.ooql.sdk.OBBase |
---|
addChange, addUniqueChange, ChangesFromXML, ChangesToXML, getChanges, getChangesAsString, getId, isLinked, removeChange, resetChanges, setId, setLinked |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Query()
public Query(java.lang.String name) throws OberonException
name
- the Query name
OberonException
- if the name contains invalid characterspublic Query(java.lang.String name, java.lang.String userName) throws OberonException
name
- the Query nameuserName
- the User
name
OberonException
- if the name contains invalid charactersMethod Detail |
---|
public static Query open(java.lang.String name, Framework framework) throws OberonException
name
- the Query nameframework
- the current framework
OberonException
- usually due to DB SQL exceptionspublic void link(Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters) throws OberonException
link
in class AdminBase
framework
- the current frameworkcounters
- administrative object synch counters (if null read them from database)
OberonException
- usually due to DB SQL exceptionspublic static Query open(java.lang.String name, java.lang.String userName, Framework framework) throws OberonException
name
- the Query nameuserName
- the User
nameframework
- the current framework
OberonException
- usually due to DB SQL exceptionspublic static Query open(java.lang.String name, java.lang.String userName, Framework framework, java.util.Hashtable<java.lang.String,java.lang.Integer> counters) throws OberonException
name
- the Query nameuserName
- the User
nameframework
- the current frameworkcounters
- administrative object synch counters (if null read them from database)
OberonException
- usually due to DB SQL exceptionspublic void create(Framework framework) throws OberonException
create
in class AdminBase
framework
- the current framework
OberonException
- usually due to DB SQL exceptions or to limited user access rightspublic void create(boolean overwrite, boolean force, Framework framework) throws OberonException
overwrite
- if true overwrite the Query when it already existsframework
- the current framework
OberonException
- usually due to DB SQL exceptions or to limited user access rightspublic void write(Framework framework) throws OberonException
write
in class AdminBase
framework
- the current framework
OberonException
- usually due to DB SQL exceptions or to limited user access rightspublic void write(boolean force, Framework framework) throws OberonException
force
- if true ignores optional featuresframework
- the current framework
OberonException
- usually due to DB SQL exceptionspublic void unlink(Framework framework) throws OberonException
unlink
in class AdminBase
framework
- the current framework
OberonException
- usually due to DB SQL exceptionspublic void destroy(Framework framework) throws OberonException
destroy
in class AdminBase
framework
- the current framework
OberonException
- usually due to DB SQL exceptions or to limited user access rightspublic void execute(java.io.DataOutputStream outStream, Framework framework) throws java.io.IOException, OberonException
outStream
- the stream for the results (if null the result is stored into the framework)framework
- the current framework
java.io.IOException
OberonException
Framework.getResult()
public void execute(Selector selector, java.io.DataOutputStream outStream, Framework framework) throws java.io.IOException, OberonException
selector
- selection parameters for result ObjectObj
instances (if null return class,name,revision and id)outStream
- the stream for the results (if null the result is stored into the framework)framework
- the current framework
java.io.IOException
OberonException
Framework.getResult()
public void count(Framework framework) throws OberonException
framework
- the current framework
OberonException
- usually due to DB SQL exceptions or to limited user access rightspublic void setUser(java.lang.String userName)
User
associated to this Query
public java.lang.String getUser()
User
associated to this Query
public void setUserId(int userID)
User
associated to this Query
public int getUserId()
User
associated to this Query
public void setMaxItems(int maxItems)
ObjectObj
instances during the Query execution
public int getMaxItems()
ObjectObj
instances during the Query execution
public void setVariable(java.lang.String varName, java.lang.String value)
varName
- the variable namevalue
- the variable valuepublic java.util.Hashtable<java.lang.String,java.lang.String> getVariables()
public void addClassPattern(java.lang.String pattern)
ObjectObj
's Class
name filter
pattern
- the filter patten (can include wildcards {*?})public void resetClassPattern()
ObjectObj
Class
name
public void setClassPattern(java.util.Vector<java.lang.String> patterns)
ObjectObj
Class
name
public java.util.Vector<java.lang.String> getClassPattern()
ObjectObj
Class
name
public java.lang.String getClassPatternAsString()
ObjectObj
Class
name as String (separated with ",")
public void addNamePattern(java.lang.String pattern)
ObjectObj
's name filter
pattern
- the filter patten (can include wildcards {*?})public void resetNamePattern()
ObjectObj
name
public void setNamePattern(java.util.Vector<java.lang.String> patterns)
ObjectObj
name
public java.util.Vector<java.lang.String> getNamePattern()
ObjectObj
name
public java.lang.String getNamePatternAsString()
ObjectObj
name as String (separated with ",")
public void addRevisionPattern(java.lang.String pattern)
ObjectObj
's revision filter
pattern
- the filter patten (can include wildcards {*?})public void resetRevisionPattern()
ObjectObj
revision
public void setRevisionPattern(java.util.Vector<java.lang.String> patterns)
ObjectObj
revision
public java.util.Vector<java.lang.String> getRevisionPattern()
ObjectObj
revision
public java.lang.String getRevisionPatternAsString()
ObjectObj
revision as String (separated with ",")
public void addHolderPattern(java.lang.String pattern)
ObjectObj
's holder filter
pattern
- the filter patten (can include wildcards {*?})public void resetHolderPattern()
ObjectObj
holder
public void setHolderPattern(java.util.Vector<java.lang.String> patterns)
ObjectObj
holder
public java.util.Vector<java.lang.String> getHolderPattern()
ObjectObj
holder
public java.lang.String getHolderPatternAsString()
ObjectObj
holder as String (separated with ",")
public void setDescriptionPattern(java.lang.String pattern)
ObjectObj
's description
pattern
- the filter patten (can include wildcards {*?})public java.lang.String getDescriptionPattern()
ObjectObj
's description
public void addLifecyclePattern(java.lang.String pattern)
ObjectObj
's Lifecycle
filter
pattern
- the filter patten (can include wildcards {*?})public void resetLifecyclePattern()
ObjectObj
Lifecycle
public void setLifecyclePattern(java.util.Vector<java.lang.String> patterns)
ObjectObj
Lifecycle
public java.util.Vector<java.lang.String> getLifecyclePattern()
ObjectObj
Lifecycle
public java.lang.String getLifecyclePatternAsString()
ObjectObj
Lifecycle
as String (separated with ",")
public void addStagePattern(java.lang.String pattern)
ObjectObj
's Stage
filter
pattern
- the filter patten (can include wildcards {*?})public void resetStagePattern()
ObjectObj
Stage
public void setStagePattern(java.util.Vector<java.lang.String> patterns)
ObjectObj
Stage
public java.util.Vector<java.lang.String> getStagePattern()
ObjectObj
Stage
public java.lang.String getStagePatternAsString()
ObjectObj
Stage
as String (separated with ",")
public void addObjectSpacePattern(java.lang.String pattern)
ObjectSpace
filter
pattern
- the filter patten (can include wildcards {*?})public void resetObjectSpacePattern()
ObjectSpace
public void setObjectSpacePattern(java.util.Vector<java.lang.String> patterns)
ObjectSpace
public java.util.Vector<java.lang.String> getObjectSpacePattern()
ObjectSpace
public java.lang.String getObjectSpacePatternAsString()
ObjectSpace
as String (separated with ",")
public void setFilter(java.lang.String expression)
expression
- boolean expression used to filter ObjectObj
instances during the query execution processpublic java.lang.String getFilter()
public void setSelector(Selector selector)
selector
- selection parameters for result ObjectObj
instances (if null return class,name,revision and id)public void saveToGroup(java.lang.String objectgroup, java.lang.String userName, boolean overwrite) throws OberonException
ObjectObj
instances into a user ObjectGroup
objectgroup
- the ObjectGroup
nameuserName
- the User
nameoverwrite
- if true update the ObjectGroup when it already exists
OberonException
public ObjectGroup getSaveGroup()
ObjectGroup
where collect the Query result ObjectObj
instances
public boolean isGroupOverwrite()
ObjectGroup
where collect the Query result ObjectObj
instances can be updated
public java.lang.String getProperty(java.lang.String propertyName, java.util.Vector<java.lang.Object> filterArgs, java.lang.String token, Framework framework)
getProperty
in class OBBase
propertyName
- OOQL property identifier/name (example: objclass , objdescr ...)filterArgs
- extra arguments used to compute propertiestoken
- separator token for complex propertiesframework
- the current framework
public java.util.Vector<?> getTargetNames(java.lang.String composedName, java.util.Vector<java.lang.Object> filterArgs, Framework framework)
getTargetNames
in class OBBase
composedName
- OOQL property identifier/namefilterArgs
- extra arguments used to compute propertiesframework
- the current framework
public java.lang.String toString()
toString
in class AdminBase
public java.lang.String toString(Framework framework)
toString
in class AdminBase
framework
- the current frameworkpublic org.jdom.Element toXML(Framework framework)
toXML
in class AdminBase
framework
- the current frameworkpublic org.jdom.Element toXML(boolean getImage, boolean fullDump, Framework framework)
toXML
in class AdminBase
fullDump
- true to include detailed informationframework
- the current frameworkgetImage
- true to include "imagedata" element with the base64 encoded image datapublic void fromXML(org.jdom.Element rootElement)
fromXML
in class AdminBase
public java.lang.String getExecuteCommand()
public java.lang.String getCreateCommand(boolean force)
getCreateCommand
in class AdminBase
force
- if true append the "force" options at the endpublic java.lang.String getCreateCommand(boolean force, boolean overwrite)
overwrite
- if true add the overwrite option to the commandpublic java.lang.String getSaveCommand(boolean force)
getSaveCommand
in class AdminBase
force
- if true append the "force" options at the endpublic java.lang.String compareUpdate(Query refQuery, boolean checkImage, boolean overwrite, boolean force, Framework framework) throws OberonException
refQuery
- the reference Query objectcheckImage
- if true compare also the image iconoverwrite
- if true update the database object instanceforce
- if true ignores optional propertiesframework
- the current framework
OberonException
fromXML(Element)
|
OBEROn SDK | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |