/* * Returns all of the messages that have been stored. * * @see edu.wpi.cs.wpisuitetng.modules.EntityManager#getAll(edu.wpi.cs.wpisuitetng.Session) */ @Override public Commitment[] getAll(Session s) throws WPISuiteException { // Ask the database to retrieve all objects of the type Commitment. // Passing a dummy Commitment lets the db know what type of object to retrieve // Passing the project makes it only get messages from that project System.out.println("Server: Retrieving all commitments"); List<Model> messages = db.retrieveAll(new Commitment(), s.getProject()); // Return the list of messages as an array return messages.toArray(new Commitment[0]); }
/* * @see edu.wpi.cs.wpisuitetng.modules.EntityManager#Count() */ @Override public int Count() throws WPISuiteException { // Return the number of Commitments currently in the database return db.retrieveAll(new Commitment()).size(); }
@Override public Project[] getAll(Session s) { Project[] ret = new Project[1]; ret = data.retrieveAll(new Project("", "")).toArray(ret); return ret; }