thanks for the response. And what if I’m still not building the mapping with JPA annotations? In my case I’m still building the mapping with an .hbm file. Then at one point in my code I’m doing the following:
session.createFilter(collection,“where language = :language”).setParameter(“language”, language).list();
Is there any workaround for this? Or the only way is by replacing it with a Query?
Those annotations have an equivalent in HBM mappings. However, HBM mappings are also deprecated. You might want to migrate to annotations, which are better supported anyway.
Other workaround is to write a Query. You can use Criteria API if the query needs to be build dynamically.
In my project, to replace all createFilter methods , it can be complex even with CriteriaQuery.
Do you know examples, with Criteria?
Following the example below , how i would apply Criteria in easy way, if my collection is
ListDefinition list = getListDefinition(listId); instead a table ?
public Collection getListColumnsOrderedByName (Long listId)
{
ListDefinition list = getListDefinition(listId);
Collection OrderedColumns = wlmDaoHelper.getListDefinitionDao().filter(list.getListColumns(), "order by this.columnName");
// Collection OrderedColumns = wlmDaoHelper.getCurrentTransactionalHibernateSession().filter(list.getListColumns(),
// “order by this.columnName”);