Joined: Tue Apr 22, 2008 10:07 am Posts: 1
|
Hi all,
I have an issue like this
There is column called URL in my schema in the following format
"file://ServerName/usr/local/tmp/xyz.xml"
I am fetching records based on my server name using 'like' operator as follows
String serverName = SystemConfiguration.getInstance().getName(); Query query = getCurrentSession().createQuery("from InterceptedResource resource where m_resourceIdentifier like '%" + serverName + "%'"); return query.list();
The server name field is not present in the entity object mapped to the schema.
Currently I am using this as a dynamic query finding the server name at the instant.
Is it possible to change the query as 'named query' inside the HBM file without having server name as an member variable in the mapped class ?
|
|