When using Lower() function must now cast to string

This commit is contained in:
Tim Donohue
2024-03-06 10:52:46 -06:00
parent 3a0ad487c4
commit c6184afc56
2 changed files with 3 additions and 3 deletions

View File

@@ -76,7 +76,7 @@ public class CollectionDAOImpl extends AbstractHibernateDSODAO<Collection> imple
"from c.metadata internal " +
"where internal.metadataField = :sortField and" +
" internal.dSpaceObject = c)" +
" ORDER BY LOWER(title.value)");
" ORDER BY LOWER(CAST(title.value as string))");
Query hibernateQuery = createQuery(context, query.toString());
if (offset != null) {
hibernateQuery.setFirstResult(offset);

View File

@@ -73,7 +73,7 @@ public class CommunityDAOImpl extends AbstractHibernateDSODAO<Community> impleme
"from c.metadata internal " +
"where internal.metadataField = :sortField and" +
" internal.dSpaceObject = c)" +
" ORDER BY LOWER(title.value)");
" ORDER BY LOWER(CAST(title.value as string))");
Query query = createQuery(context, queryBuilder.toString());
if (offset != null) {
query.setFirstResult(offset);
@@ -114,7 +114,7 @@ public class CommunityDAOImpl extends AbstractHibernateDSODAO<Community> impleme
"where internal.metadataField = :sortField and" +
" internal.dSpaceObject = c)" +
" WHERE c.parentCommunities IS EMPTY " +
" ORDER BY LOWER(title.value)");
" ORDER BY LOWER(CAST(title.value as string))");
Query query = createQuery(context, queryBuilder.toString());
query.setParameter("sortField", sortField);
query.setHint("org.hibernate.cacheable", Boolean.TRUE);