org.activemath.learner.history
Class HistoryQuery

java.lang.Object
  extended by org.activemath.learner.history.HistoryQuery

public class HistoryQuery
extends Object

Class representing the constraint sets used to query the Database.
A HistoryQuery supports setting include constraints used to constrain some values events included in the results must have, and exclude constraints used to constrain some values events in the results should not have.


Field Summary
protected static Logger log
           
 
Constructor Summary
HistoryQuery()
          Default constructor, does nothing.
HistoryQuery(String userId)
          Initializes a new HistoryQuery with an include constraint on the user id.
 
Method Summary
protected  org.hibernate.criterion.Criterion getCriteria()
          Returns a Hibernate Criterion that expresses this HistoryQuery.
 void setBookId(String bookId)
          Query a specific book
 void setBookIds(Collection<String> bookIds)
          Query a set of books
 void setEventType(String eventType)
          Query a specific event type
 void setEventTypes(Collection<String> eventTypes)
          Query a set of event types
 void setEventTypes(String[] eventTypes)
          Convenience function (Query an array of event types)
 void setExcludeEventType(String eventType)
          Exclude a specific event type from query
 void setExcludeEventTypes(Collection<String> eventTypes)
          Exclude a specific collection of event types from query
 void setExcludeEventTypes(String[] eventTypes)
          Convenience function (Exclude an array of event types from query)
 void setExcludeUsers(Collection<String> excludeUsers)
          Exclude a set of users
 void setGroupId(String groupId)
          Query a user group
 void setGroupIds(Collection<String> groupIds)
          Query a set of groups
 void setItem(Item item)
          Query a specific item
 void setItemId(String itemId)
          Query a specific item by ID
 void setItemIds(Collection<String> itemIds)
          Query a set of items by ID
 void setItemIds(String[] itemIds)
          Convenience function (Query a set of items by ID)
 void setItems(Collection<Item> items)
          Query a set of items
 void setItems(Item[] items)
          Convenience function (Query a set of items)
 void setMaxTimestamp(long maxTime)
          Query ending at a specific timestamp
 void setMinTimestamp(long minTime)
          Query beginning at a specific timestamp
 void setUserId(String userId)
          Query a specific user
 void setUserIds(Collection<String> userIds)
          Query a set of users
 void setUserIds(String[] userIds)
          Convenience function (Query an array of users)
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static Logger log
Constructor Detail

HistoryQuery

public HistoryQuery()
Default constructor, does nothing.


HistoryQuery

public HistoryQuery(String userId)
Initializes a new HistoryQuery with an include constraint on the user id.

Parameters:
userId - The userId to include in the result set.
Method Detail

setUserId

public void setUserId(String userId)
Query a specific user


setUserIds

public void setUserIds(Collection<String> userIds)
Query a set of users


setExcludeUsers

public void setExcludeUsers(Collection<String> excludeUsers)
Exclude a set of users


setBookId

public void setBookId(String bookId)
Query a specific book


setBookIds

public void setBookIds(Collection<String> bookIds)
Query a set of books


setUserIds

public void setUserIds(String[] userIds)
Convenience function (Query an array of users)


setGroupId

public void setGroupId(String groupId)
Query a user group


setGroupIds

public void setGroupIds(Collection<String> groupIds)
Query a set of groups


setEventType

public void setEventType(String eventType)
Query a specific event type


setEventTypes

public void setEventTypes(Collection<String> eventTypes)
Query a set of event types


setEventTypes

public void setEventTypes(String[] eventTypes)
Convenience function (Query an array of event types)


setExcludeEventType

public void setExcludeEventType(String eventType)
Exclude a specific event type from query


setExcludeEventTypes

public void setExcludeEventTypes(Collection<String> eventTypes)
Exclude a specific collection of event types from query


setExcludeEventTypes

public void setExcludeEventTypes(String[] eventTypes)
Convenience function (Exclude an array of event types from query)


setMinTimestamp

public void setMinTimestamp(long minTime)
Query beginning at a specific timestamp


setMaxTimestamp

public void setMaxTimestamp(long maxTime)
Query ending at a specific timestamp


setItem

public void setItem(Item item)
Query a specific item


setItems

public void setItems(Collection<Item> items)
Query a set of items


setItems

public void setItems(Item[] items)
Convenience function (Query a set of items)


setItemId

public void setItemId(String itemId)
Query a specific item by ID


setItemIds

public void setItemIds(Collection<String> itemIds)
Query a set of items by ID


setItemIds

public void setItemIds(String[] itemIds)
Convenience function (Query a set of items by ID)


getCriteria

protected org.hibernate.criterion.Criterion getCriteria()
Returns a Hibernate Criterion that expresses this HistoryQuery. The returned Criterion is a Conjunction of the Disjunction of the include constraints and the negation of the Disjunction of the exclude constraints.

Returns:
A Criterion that expresses this HistoryQuery.

toString

public String toString()
Overrides:
toString in class Object