Package de.espirit.or.query
Interface Select
- All Superinterfaces:
Cloneable,Serializable
Model representing a Select statement to
query entites from an
or session. A Select is related to one entityType and can be created
via Session.createSelect(entityTypeName) with the name of the entity type.- Since:
- 4.0.17
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidAppends the given order criteria to the list of definedordersof this select.voidAdds the given parameter to this select.applyLanguage(@NotNull String languageAbbreviation) Make a clone of this select and replace all place holders%lang%contained in constaints with the givenlanguageAbbreviationvoidClears the definedorder criteriasof this select.booleancontainsParameter(@NotNull String identifier) Indicates whether a parameter specified by the given identifier exists or not.Get the current language applied to this select, if available.@Nullable ConstraintReturn the constraint defined by this select.Return the name of the entity type which entities in the result set belong to.List<de.espirit.or.query.FetchMode>Returns all fetch modes defined by this select.intReturn the fetch size which will applied to the JDBC ResultSet to retrieve data from the database.intThe maximum number of entities this select will return.Returns an unmodifiable list of definedordersof this select.getParameter(@NotNull String identifier) Return the parameter with the givenidentifier.Return all parameters defined by this select.getParameterValue(@NotNull String identifier) Returns the value of the parameter specified by given identifier ornullif no parameter exists with the given identifier.getXML()Returns the xml representation of this select model.booleanReturn true if this select is constructed from a 3.1 query document.booleanReturn true if an order of the attributeattributeNameis already defined in this select.voidsetConstraint(Constraint constraint) Set the select constraint toconstraint.voidsetDeprecated(boolean flag) Set this select to deprecated or not.voidsetFetchSize(int size) Sets the fetch size for this select which will be applied to the resultEntityListreturned byexecuteQuery(Select).voidsetMaxResultCount(int maxResultCount) Set the maximum number of entities this select will return.voidsetParameter(@NotNull String identifier, Object value) Sets the value for theparameterspecified by the given identifier.
-
Method Details
-
isDeprecated
boolean isDeprecated()Return true if this select is constructed from a 3.1 query document.- Since:
- 4.0.17
-
setDeprecated
void setDeprecated(boolean flag) Set this select to deprecated or not. A deprcated select is the one was constructed from a 3.1 query.- Since:
- 4.0.17
-
getEntityTypeName
String getEntityTypeName()Return the name of the entity type which entities in the result set belong to. Each select produces results from one entity type (table) even more than one entity types can be involved in the constraint of the select.- Since:
- 4.0.17
-
setConstraint
Set the select constraint toconstraint.- Throws:
ORException- Since:
- 4.0.17
-
getConstraint
Return the constraint defined by this select.- Since:
- 4.0.17
-
getParameter
Return the parameter with the givenidentifier.- Throws:
ORException- Since:
- 4.0.17
-
getParameters
Collection<Parameter> getParameters()Return all parameters defined by this select.- Since:
- 4.0.17
- See Also:
-
add
Adds the given parameter to this select.- Since:
- 4.0.17
- See Also:
-
getFetchModes
List<de.espirit.or.query.FetchMode> getFetchModes()Returns all fetch modes defined by this select.- Since:
- 4.0.17
-
getParameterValue
Returns the value of the parameter specified by given identifier ornullif no parameter exists with the given identifier.- Since:
- 4.0.17
- See Also:
-
setParameter
Sets the value for theparameterspecified by the given identifier. The given value must match thevalue classof the parameter. The parameter needs to be registered withadd(Parameter)first.- Throws:
IllegalArgumentException- if noparameterexists with the given identifierORException- Since:
- 4.0.17
- See Also:
-
getOrders
Returns an unmodifiable list of definedordersof this select. The sequence of the list defines the priority of the ordering.- Since:
- 4.0.17
- See Also:
-
isOrdered
Return true if an order of the attributeattributeNameis already defined in this select.- Since:
- 4.0.30
-
add
Appends the given order criteria to the list of definedordersof this select.- Since:
- 4.0.17
- See Also:
-
setFetchSize
void setFetchSize(int size) Sets the fetch size for this select which will be applied to the resultEntityListreturned byexecuteQuery(Select). The given fetchsize defines the block size of the EntityList which is a lazy list and queries its data in blocks of a specific size. The given fetch size defines the block size of the entity list. If fetch size is not specified the default block size (40 items) will be used for the query result, which is suited for the most use cases.- Since:
- 4.0.17
- See Also:
-
getFetchSize
int getFetchSize()Return the fetch size which will applied to the JDBC ResultSet to retrieve data from the database.- Since:
- 4.0.17
- See Also:
-
getXML
String getXML()Returns the xml representation of this select model.- Since:
- 4.0.17
-
clearOrdering
void clearOrdering()Clears the definedorder criteriasof this select.- Since:
- 4.0.17
- See Also:
-
containsParameter
Indicates whether a parameter specified by the given identifier exists or not.- Returns:
trueif a parameter specified by the given identifier exists,falseotherwise- Since:
- 4.0.17
-
getMaxResultCount
int getMaxResultCount()The maximum number of entities this select will return. A value of0means no restriction (default).- Since:
- 4.0.19
- See Also:
-
setMaxResultCount
void setMaxResultCount(int maxResultCount) Set the maximum number of entities this select will return. A value of0means no restriction (default).- Since:
- 4.0.19
- See Also:
-
applyLanguage
Make a clone of this select and replace all place holders%lang%contained in constaints with the givenlanguageAbbreviation- Returns:
- the clone of this select for the language
languageAbbreviation - Since:
- 4.0.26
-
getAppliedLanguage
Get the current language applied to this select, if available.- Returns:
- The language abbreviation if available.
- Since:
- 5.2.250604
-