Forums de discussion

Issue importing Custom SQL in *FinderImpl

Zachary Mayry, modifié il y a 7 années.

Issue importing Custom SQL in *FinderImpl

New Member Publications: 14 Date d'inscription: 24/02/17 Publications récentes
I've followed the instructions in this blog because I find writing SQL easier than writing a Dynamic Query. Also I would like to use joins so there's another reason.

I follow all the steps, but I when I add this line:
import com.liferay.util.dao.orm.CustomSQLUtil;


I get this error:
The import com.liferay.util cannot be resolved


On a side note, how do the finder columns in service.xml work with Custom SQL? Do I need them?
thumbnail
David H Nebinger, modifié il y a 7 années.

RE: Issue importing Custom SQL in *FinderImpl

Liferay Legend Publications: 14919 Date d'inscription: 02/09/06 Publications récentes
The package comes from the util-java jar, you'll need to include it to your build path.

Finder columns do not relate to the custom sql. Finder columns just define a built-in finder to return lists from the Liferay data.

Note that DQ supports performing joins also. Not that I'm telling you that you must use DQ, but needing joins does not disqualify DQ as a solution.