On Friday, September 8, 2017 at 5:20:14 AM UTC-4, [email protected] wrote: > > In an odler version of dspace (3.2) I used to use the class > DatabaseManager, TableRow and TableRowIterator for manage information of > the database (psql). > > Now in the new version of dspace I'm not able to modify > AcceptEditRejectAction.java to adapt the previous code to the new one. > > TableRowIterator tri = DatabaseManager.queryTable(c,"eperson", > "SELECT persona.email FROM eperson persona, > cwf_collectionrole persona2, epersongroup2eperson persona3 WHERE > persona2.group_id = persona3.eperson_group_id AND persona3.eperson_id = > persona.eperson_id AND persona2.role_id ='local' AND > persona2.collection_id= ?", idcoll); > > List<TableRow> emailRows = tri.toList(); > for (int i = 0; i < emailRows.size(); i++){ > TableRow row = (TableRow) emailRows.get(i); > emailPersona = row.getStringColumn("email"); > email.addRecipient(emailPersona); > } > > Does someone know how to adapt that code to the new version?? >
There have been big changes in database access. See https://wiki.duraspace.org/display/DSPACE/DSpace+Database+Access for details. Probably you need to get an instance of EPersonService and pass your query to its search(Context, String) method. Your existing query will have to be translated from SQL to HQL, but should be quite similar. You'll get back a List<EPerson> and can just call each element's getEmail() method. -- You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/dspace-tech. For more options, visit https://groups.google.com/d/optout.
