You are viewing an older version of this section. Click here to navigate to the latest version.

MQL Spring Integration

MQL can integrate transparently into your Spring application. You just need to give it your ApplicationContext when you’re performing your query.

For example:

 import org.mule.mql.Query;import org.mule.mql.spring.SpringQueryContext;// Your Spring ApplicationContext. See the ApplicationContextAware interface to see how to retrieve thisApplicationContext applicationContext = ....;// Create a Query context which delegates to thisSpringQueryContext queryContext = new SpringQueryContext(applicationContext);Collection result = Query.execute("from ...."/>