NPersistence Reference Guide
Interface used to control the execution of typed queries.

query result type

Namespace: NPersistence
Assembly: NPersistence (in NPersistence.dll) Version: 2.0.0.0 (2.0.0.0)

Syntax

   
 C# 
public interface TypedQuery<X> : Query

Type Parameters

X

Members

      
 All Members  Methods  
 Public

 Protected
 Instance

 Static 
 Declared

 Inherited
 XNA Framework Only 

 .NET Compact Framework Only 

 MemberDescription
ExecuteUpdate()()()()
Execute an update or delete statement.
(Inherited from Query.)
GetFirstResult()()()()
The position of the first result the query object was set to retrieve. Returns 0 if setFirstResult was not applied to the query object.
(Inherited from Query.)
GetFlushMode()()()()
Get the flush mode in effect for the query execution. If a flush mode has not been set for the query object, returns the flush mode in effect for the entity manager.
(Inherited from Query.)
GetHints()()()()
Get the properties and hints and associated values that are in effect for the query instance.
(Inherited from Query.)
GetLockMode()()()()
Get the current lock mode for the query.
(Inherited from Query.)
GetMaxResults()()()()
The maximum number of results the query object was set to retrieve. Returns Integer.MAX_VALUE if setMaxResults was not applied to the query object.
(Inherited from Query.)
GetParameter<(Of <<'(T>)>>)(Int32)
Get the parameter object corresponding to the declared positional parameter with the given position. This method is not required to be supported for native queries.
(Inherited from Query.)
GetParameter<(Of <<'(T>)>>)(String)
Get the parameter object corresponding to the declared parameter of the given name. This method is not required to be supported for native queries.
(Inherited from Query.)
GetParameter<(Of <<'(T>)>>)(Int32, Type)
Get the parameter object corresponding to the declared positional parameter with the given position and type. This method is not required to be supported by the provider.
(Inherited from Query.)
GetParameter<(Of <<'(T>)>>)(String, Type)
Get the parameter object corresponding to the declared parameter of the given name and type. This method is required to be supported for criteria queries only.
(Inherited from Query.)
GetParameters()()()()
Get the parameter objects corresponding to the declared parameters of the query. Returns empty set if the query has no parameters. This method is not required to be supported for native queries.
(Inherited from Query.)
GetParameterValue(Int32)
Return the value bound to the positional parameter.
(Inherited from Query.)
GetParameterValue(String)
Return the value bound to the named parameter.
(Inherited from Query.)
GetParameterValue<(Of <<'(T>)>>)(Parameter<(Of <<'(T>)>>))
Return the value bound to the parameter.
(Inherited from Query.)
GetResultList()()()()
Execute a SELECT query and return the query results as an untyped List.
(Inherited from Query.)
GetResultList()()()()
Execute a SELECT query and return the query results as a typed List.

Return Value

a list of the results if called for a Java Persistence query language UPDATE or DELETE statement if the query execution exceeds the query timeout value set and only the statement is rolled back if a lock mode has been set and there is no transaction if pessimistic locking fails and the transaction is rolled back if pessimistic locking fails and only the statement is rolled back if the query execution exceeds the query timeout value set and the transaction is rolled back
GetSingleResult()()()()
Execute a SELECT query that returns a single untyped result.
(Inherited from Query.)
GetSingleResult()()()()
Execute a SELECT query that returns a single result.

Return Value

the result if there is no result if more than one result if called for a Java Persistence query language UPDATE or DELETE statement if the query execution exceeds the query timeout value set and only the statement is rolled back if a lock mode has been set and there is no transaction if pessimistic locking fails and the transaction is rolled back if pessimistic locking fails and only the statement is rolled back if the query execution exceeds the query timeout value set and the transaction is rolled back
IsBound<(Of <<'(T>)>>)(Parameter<(Of <<'(T>)>>))
Return a boolean indicating whether a value has been bound to the parameter.
(Inherited from Query.)
SetFirstResult(Int32)
Set the position of the first result to retrieve.
(Inherited from Query.)
SetFirstResult(Int32)
Set the position of the first result to retrieve. position of the first result, numbered from 0

Return Value

the same query instance if the argument is negative
SetFlushMode(FlushModeType)
Set the flush mode type to be used for the query execution. The flush mode type applies to the query regardless of the flush mode type in use for the entity manager.
(Inherited from Query.)
SetFlushMode(FlushModeType)
Set the flush mode type to be used for the query execution. The flush mode type applies to the query regardless of the flush mode type in use for the entity manager. flush mode

Return Value

the same query instance
SetHint(String, Object)
Set a query property or hint. The hints elements may be used to specify query properties and hints. Properties defined by this specification must be observed by the provider. Vendor-specific hints that are not recognized by a provider must be silently ignored. Portable applications should not rely on the standard timeout hint. Depending on the database in use and the locking mechanisms used by the provider, this hint may or may not be observed.
(Inherited from Query.)
SetHint(String, Object)
Set a query property or hint. The hints elements may be used to specify query properties and hints. Properties defined by this specification must be observed by the provider. Vendor-specific hints that are not recognized by a provider must be silently ignored. Portable applications should not rely on the standard timeout hint. Depending on the database in use and the locking mechanisms used by the provider, this hint may or may not be observed. name of property or hint value for the property or hint

Return Value

the same query instance if the second argument is not valid for the implementation
SetLockMode(LockModeType)
Set the lock mode type to be used for the query execution.
(Inherited from Query.)
SetLockMode(LockModeType)
Set the lock mode type to be used for the query execution. lock mode

Return Value

the same query instance if the query is found not to be a Java Persistence query language SELECT query or a Criteria API query
SetMaxResults(Int32)
Set the maximum number of results to retrieve.
(Inherited from Query.)
SetMaxResults(Int32)
Set the maximum number of results to retrieve. maximum number of results to retrieve

Return Value

the same query instance if the argument is negative
SetParameter(Int32, Object)
Bind an argument to a positional parameter.
(Inherited from Query.)
SetParameter(String, Object)
Bind an argument to a named parameter.
(Inherited from Query.)
SetParameter(Int32, Object)
Bind an argument to a positional parameter. position parameter value

Return Value

the same query instance if position does not correspond to a positional parameter of the query or if the argument is of incorrect type
SetParameter(String, Object)
Bind an argument to a named parameter. parameter name parameter value

Return Value

the same query instance if the parameter name does not correspond to a parameter of the query or if the argument is of incorrect type
SetParameter<(Of <<'(T>)>>)(Parameter<(Of <<'(T>)>>), T)
Bind the value of a Parameter object.
(Inherited from Query.)
SetParameter<(Of <<'(T>)>>)(Parameter<(Of <<'(T>)>>), T)
Bind the value of a Parameter object. parameter object parameter value

Return Value

the same query instance if the parameter does not correspond to a parameter of the query
SetParameter(Int32, DateTime, TemporalType)
Bind an instance of System.DateTime to a positional parameter.
(Inherited from Query.)
SetParameter(String, DateTime, TemporalType)
Bind an instance of System.DateTime to a named parameter.
(Inherited from Query.)
SetParameter(Int32, DateTime, TemporalType)
Bind an instance of System.DateTime to a positional parameter. position parameter value temporal type

Return Value

the same query instance if position does not correspond to a positional parameter of the query or if the value argument is of incorrect type
SetParameter(String, DateTime, TemporalType)
Bind an instance of System.DateTime to a named parameter. parameter name parameter value temporal type

Return Value

the same query instance if the parameter name does not correspond to a parameter of the query or if the value argument is of incorrect type
SetParameter(Parameter<(Of <<'(DateTime>)>>), DateTime, TemporalType)
Bind an instance of System.DateTime to a Parameter object.
(Inherited from Query.)
SetParameter(Parameter<(Of <<'(DateTime>)>>), DateTime, TemporalType)
Bind an instance of System.DateTime to a Parameter object. parameter object parameter value temporal type

Return Value

the same query instance if the parameter does not correspond to a parameter of the query
Unwrap<(Of <<'(T>)>>)(Type)
Return an object of the specified type to allow access to the provider-specific API. If the provider's query implementation does not support the specified class, the PersistenceException is thrown.
(Inherited from Query.)

See Also