org.openrdf.elmo.sesame
Class SesameQuery

java.lang.Object
  extended by org.openrdf.elmo.sesame.SesameQuery
All Implemented Interfaces:
Query, ElmoQuery

public class SesameQuery
extends Object
implements ElmoQuery, Query

Implements ElmoQuery for use with SesameManager.

Author:
James Leigh

Field Summary
protected  SesameManager manager
           
protected  TupleQuery query
           
 
Constructor Summary
SesameQuery(SesameManager manager, TupleQuery query)
           
 
Method Summary
 void close()
          Closes any open results from this query.
 Iterator evaluate()
          Evaluates the query and returns an iterator over the result.
 int executeUpdate()
           
 boolean getIncludeInferred()
           
 List getResultList()
          Evaluates the query and returns the results disconnected from the query.
 Object getSingleResult()
          Evaluates the query and return the first result.
 SesameQuery setFirstResult(int startPosition)
          Skips to the startPosition of the results.
 SesameQuery setFlushMode(FlushModeType flushMode)
           
 SesameQuery setHint(String hintName, Object value)
           
 void setIncludeInferred(boolean include)
           
 SesameQuery setMaxResults(int maxResult)
          Terminates the result list after reading maxResult
 SesameQuery setParameter(int arg0, Calendar arg1, TemporalType arg2)
           
 SesameQuery setParameter(int arg0, Date arg1, TemporalType arg2)
           
 SesameQuery setParameter(int arg0, Object arg1)
           
 SesameQuery setParameter(String name, Calendar value, TemporalType temporalType)
           
 SesameQuery setParameter(String name, Date value, TemporalType temporalType)
           
 SesameQuery setParameter(String name, Object value)
          Assigns an entity or literal to the given name.
 ElmoQuery setParameter(String name, String label, Locale locale)
          Binds a literal with no type and a language of locale.
 SesameQuery setQName(String name, QName qname)
          Assigns entity by name to the given parameter name.
 SesameQuery setType(String name, Class<?> concept)
          Assigns a concept to the given name.
 SesameQuery setValue(String name, Value value)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

manager

protected SesameManager manager

query

protected TupleQuery query
Constructor Detail

SesameQuery

public SesameQuery(SesameManager manager,
                   TupleQuery query)
Method Detail

close

public void close()
Description copied from interface: ElmoQuery
Closes any open results from this query.

Specified by:
close in interface ElmoQuery

evaluate

public Iterator evaluate()
Description copied from interface: ElmoQuery
Evaluates the query and returns an iterator over the result.

Specified by:
evaluate in interface ElmoQuery
Returns:
Iterator over the result of the query.

getSingleResult

public Object getSingleResult()
Description copied from interface: ElmoQuery
Evaluates the query and return the first result.

Specified by:
getSingleResult in interface Query
Specified by:
getSingleResult in interface ElmoQuery
Returns:
The first result from the query.

getResultList

public List getResultList()
Description copied from interface: ElmoQuery
Evaluates the query and returns the results disconnected from the query.

Specified by:
getResultList in interface Query
Specified by:
getResultList in interface ElmoQuery
Returns:
The results from the query.

setFirstResult

public SesameQuery setFirstResult(int startPosition)
Description copied from interface: ElmoQuery
Skips to the startPosition of the results.

Specified by:
setFirstResult in interface Query
Specified by:
setFirstResult in interface ElmoQuery

setMaxResults

public SesameQuery setMaxResults(int maxResult)
Description copied from interface: ElmoQuery
Terminates the result list after reading maxResult

Specified by:
setMaxResults in interface Query
Specified by:
setMaxResults in interface ElmoQuery

getIncludeInferred

public boolean getIncludeInferred()

setIncludeInferred

public void setIncludeInferred(boolean include)

setParameter

public ElmoQuery setParameter(String name,
                              String label,
                              Locale locale)
Description copied from interface: ElmoQuery
Binds a literal with no type and a language of locale.

Specified by:
setParameter in interface ElmoQuery
Parameters:
name - Name of the variable to bind to.

setParameter

public SesameQuery setParameter(String name,
                                Object value)
Description copied from interface: ElmoQuery
Assigns an entity or literal to the given name.

Specified by:
setParameter in interface Query
Specified by:
setParameter in interface ElmoQuery
Parameters:
name - Name of the variable to bind to.
value - managed entity or literal.

setType

public SesameQuery setType(String name,
                           Class<?> concept)
Description copied from interface: ElmoQuery
Assigns a concept to the given name.

Specified by:
setType in interface ElmoQuery
Parameters:
name - Name of the variable to bind to.
concept - Registered concept.

setQName

public SesameQuery setQName(String name,
                            QName qname)
Description copied from interface: ElmoQuery
Assigns entity by name to the given parameter name.

Specified by:
setQName in interface ElmoQuery
Parameters:
name - Name of the variable to bind to.
qname - Name of the entity.

setValue

public SesameQuery setValue(String name,
                            Value value)

toString

public String toString()
Overrides:
toString in class Object

executeUpdate

public int executeUpdate()
Specified by:
executeUpdate in interface Query

setFlushMode

public SesameQuery setFlushMode(FlushModeType flushMode)
Specified by:
setFlushMode in interface Query

setHint

public SesameQuery setHint(String hintName,
                           Object value)
Specified by:
setHint in interface Query

setParameter

public SesameQuery setParameter(String name,
                                Date value,
                                TemporalType temporalType)
Specified by:
setParameter in interface Query

setParameter

public SesameQuery setParameter(String name,
                                Calendar value,
                                TemporalType temporalType)
Specified by:
setParameter in interface Query

setParameter

public SesameQuery setParameter(int arg0,
                                Object arg1)
Specified by:
setParameter in interface Query

setParameter

public SesameQuery setParameter(int arg0,
                                Date arg1,
                                TemporalType arg2)
Specified by:
setParameter in interface Query

setParameter

public SesameQuery setParameter(int arg0,
                                Calendar arg1,
                                TemporalType arg2)
Specified by:
setParameter in interface Query


Copyright © 2004-2008 Aduna. All Rights Reserved.