@Test public void testFindAll() throws Exception { WorkspaceItem[] found = WorkspaceItem.findAll(context); assertTrue("testFindAll 0",found.length >= 1); boolean added = false; for(WorkspaceItem f: found) { assertThat("testFindAll 1",f,notNullValue()); assertThat("testFindAll 2",f.getItem(),notNullValue()); assertThat("testFindAll 3",f.getSubmitter(),notNullValue()); if(f.equals(wi)) { added = true; } } assertTrue("testFindAll 4",added); }
public static WorkspaceItem[] findAll(Context context) throws SQLException { List<WorkspaceItem> wsItems = new ArrayList<WorkspaceItem>(); String query = "SELECT * FROM workspaceitem ORDER BY item_id"; TableRowIterator tri = DatabaseManager.queryTable(context, "workspaceitem", query); try { while (tri.hasNext()) { TableRow row = tri.next(); WorkspaceItem wi = (WorkspaceItem) context.fromCache( WorkspaceItem.class, row.getIntColumn("workspace_item_id")); if (wi == null) { wi = new WorkspaceItem(context, row); } wsItems.add(wi); } } finally { if (tri != null) { tri.close(); } } return wsItems.toArray(new WorkspaceItem[wsItems.size()]); }
WorkspaceItem implements InProgressSubmission { public static WorkspaceItem[] findAll(Context context) throws SQLException { List<WorkspaceItem> wsItems = new ArrayList<WorkspaceItem>(); String query = "SELECT * FROM workspaceitem ORDER BY item_id"; TableRowIterator tri = DatabaseManager.queryTable(context, "workspaceitem", query); try { while (tri.hasNext()) { TableRow row = tri.next(); WorkspaceItem wi = (WorkspaceItem) context.fromCache( WorkspaceItem.class, row.getIntColumn("workspace_item_id")); if (wi == null) { wi = new WorkspaceItem(context, row); } wsItems.add(wi); } } finally { if (tri != null) { tri.close(); } } return wsItems.toArray(new WorkspaceItem[wsItems.size()]); } }
WorkspaceItem implements InProgressSubmission { public static WorkspaceItem[] findAll(Context context) throws SQLException { List<WorkspaceItem> wsItems = new ArrayList<WorkspaceItem>(); String query = "SELECT * FROM workspaceitem ORDER BY item_id"; TableRowIterator tri = DatabaseManager.queryTable(context, "workspaceitem", query); try { while (tri.hasNext()) { TableRow row = tri.next(); WorkspaceItem wi = (WorkspaceItem) context.fromCache( WorkspaceItem.class, row.getIntColumn("workspace_item_id")); if (wi == null) { wi = new WorkspaceItem(context, row); } wsItems.add(wi); } } finally { if (tri != null) { tri.close(); } } return wsItems.toArray(new WorkspaceItem[wsItems.size()]); } WorkspaceItem(Context context, TableRow row); }
WorkspaceItem implements InProgressSubmission { public static WorkspaceItem[] findAll(Context context) throws SQLException { List<WorkspaceItem> wsItems = new ArrayList<WorkspaceItem>(); String query = "SELECT * FROM workspaceitem ORDER BY item_id"; TableRowIterator tri = DatabaseManager.queryTable(context, "workspaceitem", query); try { while (tri.hasNext()) { TableRow row = tri.next(); WorkspaceItem wi = (WorkspaceItem) context.fromCache( WorkspaceItem.class, row.getIntColumn("workspace_item_id")); if (wi == null) { wi = new WorkspaceItem(context, row); } wsItems.add(wi); } } finally { if (tri != null) { tri.close(); } } return wsItems.toArray(new WorkspaceItem[wsItems.size()]); } WorkspaceItem(Context context, TableRow row); static WorkspaceItem find(Context context, int id); static WorkspaceItem create(Context c, Collection coll,
            boolean template); static WorkspaceItem[] findByEPerson(Context context, EPerson ep); static WorkspaceItem[] findByCollection(Context context, Collection c); static WorkspaceItem findByItem(Context context, Item i); static WorkspaceItem[] findAll(Context context); int getID(); int getStageReached(); void setStageReached(int v); int getPageReached(); void setPageReached(int v); void update(); boolean equals(Object o); int hashCode(); void deleteAll(); void deleteWrapper(); Item getItem(); Collection getCollection(); EPerson getSubmitter(); boolean hasMultipleFiles(); void setMultipleFiles(boolean b); boolean hasMultipleTitles(); void setMultipleTitles(boolean b); boolean isPublishedBefore(); void setPublishedBefore(boolean b); }
WorkspaceItem implements InProgressSubmission { public static WorkspaceItem[] findAll(Context context) throws SQLException { List<WorkspaceItem> wsItems = new ArrayList<WorkspaceItem>(); String query = "SELECT * FROM workspaceitem ORDER BY item_id"; TableRowIterator tri = DatabaseManager.queryTable(context, "workspaceitem", query); try { while (tri.hasNext()) { TableRow row = tri.next(); WorkspaceItem wi = (WorkspaceItem) context.fromCache( WorkspaceItem.class, row.getIntColumn("workspace_item_id")); if (wi == null) { wi = new WorkspaceItem(context, row); } wsItems.add(wi); } } finally { if (tri != null) { tri.close(); } } return wsItems.toArray(new WorkspaceItem[wsItems.size()]); } WorkspaceItem(Context context, TableRow row); static WorkspaceItem find(Context context, int id); static WorkspaceItem create(Context c, Collection coll,
            boolean template); static WorkspaceItem[] findByEPerson(Context context, EPerson ep); static WorkspaceItem[] findByCollection(Context context, Collection c); static WorkspaceItem findByItem(Context context, Item i); static WorkspaceItem[] findAll(Context context); int getID(); int getStageReached(); void setStageReached(int v); int getPageReached(); void setPageReached(int v); void update(); boolean equals(Object o); int hashCode(); void deleteAll(); void deleteWrapper(); Item getItem(); Collection getCollection(); EPerson getSubmitter(); boolean hasMultipleFiles(); void setMultipleFiles(boolean b); boolean hasMultipleTitles(); void setMultipleTitles(boolean b); boolean isPublishedBefore(); void setPublishedBefore(boolean b);  }