@Immutable public interface SQLStatementFactory
Interface for producing sql strings rating DAO queries.
The JDBC DAO framework operates by expecting a statement factory to construct queries which return results in a defined format.
Modifier and Type | Method and Description |
---|---|
String |
prepareEvents(SortOrder order)
Prepare a statement to satisfy
EventDAO.streamEvents(Class, SortOrder) . |
String |
prepareItemEvents()
Prepare a statement to satisfy
ItemEventDAO.getEventsForItem(long) . |
String |
prepareItems()
Prepare a statement to satisfy
ItemDAO.getItemIds() . |
String |
prepareItemUsers()
Prepare a statement to satisfy
ItemEventDAO.getUsersForItem(long) . |
String |
prepareUserEvents()
Prepare a statement to satisfy
UserEventDAO.getEventsForUser(long) . |
String |
prepareUsers()
Prepare a statement to satisfy
UserDAO.getUserIds() . |
String prepareUsers()
Prepare a statement to satisfy UserDAO.getUserIds()
. Querying the statement should return one column per row containing the numeric user ID.
String prepareItems()
Prepare a statement to satisfy ItemDAO.getItemIds()
. Querying the statement should return one column per row containing the numeric item ID.
String prepareEvents(SortOrder order)
Prepare a statement to satisfy EventDAO.streamEvents(Class, SortOrder)
. Each row should contain three or four columns: the user ID, the item ID, the rating, and (optionally) the timestamp. The timestamp column is allowed to contain NULL values or to be omitted entirely. User, item, and rating columns must be non-null.
order
- The sort orderString prepareUserEvents()
Prepare a statement to satisfy UserEventDAO.getEventsForUser(long)
. The returned rows should be as in prepareEvents(SortOrder)
, and the prepared statement should take a single parameter for the user ID.
String prepareItemEvents()
Prepare a statement to satisfy ItemEventDAO.getEventsForItem(long)
. The returned rows should be as in prepareEvents(SortOrder)
, and the prepared statement should take a single parameter for the item ID.
String prepareItemUsers()
Prepare a statement to satisfy ItemEventDAO.getUsersForItem(long)
. The returned rows should each contain a user ID as their only column, and the statement should take a single parameter for the item ID.