I have a requirement to implement cache, with that cache it will execute Hibernate query.
I want to fetch the value(option_key) from the cache.xml, that loaded value should be placed in the SQL query. Later hibernate will execute that query. Is there any way I can do like that.
cache.xml
<section name="system_configuration">
<entry key="option_key" value="some_value" />
MyCache.java
public List getList()
{
String mysqlquery = "SELECT OPTION_SETTING FROM CONFIGURATION WHERE"
+ " OPTION_NAME='some_column_name' AND OPTION_KEY='value_from_cache.xml'";
Session ses= sessionFactory.openSession();
Query query = ses.createSQLQuery(mysqlquery);
List result = query.list();
return result;
}