@Override
public List<EPerson> findProxiesForDepositor(Context context, UUID depositor_id) throws SQLException {
Query query = getHibernateSession(context).createSQLQuery("SELECT * FROM EPerson WHERE uuid in (SELECT proxy_id from proxies where depositor_id =:depositor_id)");
query.addEntity(EPerson.class);
query.setParameter("depositor_id", depositor_id);
List<EPerson> epersons = query.list();
return epersons;
}
It's telling me that :
[ERROR] EPersonDAOImpl.java:[187,14] cannot find symbol
[ERROR] symbol: method addEntity(java.lang.Class<org.dspace.eperson.EPerson>)
[ERROR] location: variable query of type org.hibernate.Query
I found something on the web that suggested I could do it this way.
If someone could correct this query, that would really help me because I have others like it.
Thank you!
-Jose
Query q = getHibernateSession(context).createSQLQuery("SELECT * FROM EPerson WHERE uuid in (SELECT proxy_id from proxies where depositor_id = '" + depositor_id.toString() + "')");
q.setResultTransformer(Transformers.aliasToBean(EPerson.class));
List<EPerson> results = q.list();
return results;
And I'm getting:
org.hibernate.MappingException: No Dialect mapping for JDBC type: 1111
in this line:
List<EPerson> results = q.list();
--
All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
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 dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/20200226141439.GB8836%40IUPUI.Edu.
@Override
public ResourcePolicy createResourcePolicy(Context context, DSpaceObject dso, Group group, EPerson eperson, int type, String rpType) throws SQLException, AuthorizeException {
if(group == null && eperson == null)
{
throw new IllegalArgumentException("We need at least an eperson or a group in order to create a resource policy.");
}
ResourcePolicy myPolicy = resourcePolicyService.create(context);
myPolicy.setdSpaceObject(dso);
myPolicy.setAction(type);
myPolicy.setGroup(group);
myPolicy.setEPerson(eperson);
myPolicy.setRpType(rpType);
resourcePolicyService.update(context, myPolicy);
return myPolicy;
}