While I had no problems with the CustomSQLUtil class in Liferay 6.2, I encounter a problem with the new version of this class in Liferay 7. Indeed, the get method returns null instead of the expected query.
Has anyone reproduced this?
Here is a description of my latest Eclipse Mars test:
- In my Liferay workspace, I added the following line to the build.gradle of the service module
compileOnly group: "com.liferay", name: "com.liferay.portal.dao.orm.custom.sql", version: "1.0.5"
After updating gradle, I can use the CustomSQLUtil class in my FooFinderImpl class to get the corresponding query.
This query was written in the default.xml file, which is uploaded to the src / custom-sql folder, as indicated in the Liferay 7 documentation:
https://dev.liferay.com/develop/tutorials/-/knowledge_base/7-0/custom-sql
I tried with many places (in META-INF, in ressources ..), I even tried to expand my own CustomSQL class to get the configuration, but the getSQL method of the CustomSQLUtil class always returns null sql queries.
PS: I noticed that this new method "CustomSQLUtil.get" now takes 2 parameters, the class is requested in addition to the request identifier. In this class parameter, I put the value "Foo.class".
Does anyone know if there is a configuration? Should the pathpath or bundlecontext class be configured?