DS-3280 Fix HQL Syntax at HandleDAOImpl

Solved the error when executing ./dspace update-handle-prefix
in commandline. There were some errors in the HQL syntax at
HandleDAOImpl class when updating the HANDLE table.
This commit is contained in:
FacundoAdorno
2016-08-05 14:32:35 -03:00
parent 39708d223d
commit d09e8036a9

View File

@@ -83,7 +83,7 @@ public class HandleDAOImpl extends AbstractHibernateDAO<Handle> implements Handl
@Override
public int updateHandlesWithNewPrefix(Context context, String newPrefix, String oldPrefix) throws SQLException
{
String hql = "UPDATE handle set handle = concat(:newPrefix,'/',id WHERE handle like :oldPrefix%";
String hql = "UPDATE Handle set handle = concat(:newPrefix,'/',handle_id) WHERE handle like concat(:oldPrefix,'%')";
Query query = createQuery(context, hql);
query.setString("newPrefix", newPrefix);
query.setString("oldPrefix", oldPrefix);