AssetEntryQuery忽略我设置的所有参数,从而执行通配符查询并检索所有资产条目。Liferay 7忽略AssetEntryQuery参数
片段的我在做什么现在:
long[] classTypeIds = new long[] { 30837 };
AssetEntryQuery assetQuery = new AssetEntryQuery();
assetQuery.setClassTypeIds(classTypeIds);
List<AssetEntry> entries = AssetEntryLocalServiceUtil.getEntries(assetQuery);
foreach (AssetEntry entry : entries) {
System.out.printf("Entry with classTypeId %d expected %d", entry.getClassTypeId(), 30837);
}
当我执行这个代码,它的Liferay返回所有项的列表没有他们classTypeId被过滤。
输出:
[...]
Entry with classTypeId 0 expected 30837
Entry with classTypeId 0 expected 30837
Entry with classTypeId 28920 expected 30837
Entry with classTypeId 30331 expected 30837
Entry with classTypeId 30837 expected 30837
Entry with classTypeId 30837 expected 30837
Entry with classTypeId 30837 expected 30837
Entry with classTypeId 30921 expected 30837
[...]
我思念的东西,所以Liferay的无视我的AssetEntryQuery params中,是内Liferay的本身就是一个错误?
我很好奇你的情况。该代码认识到有不同的'classTypeId's(所以它与数据库中0的值没有关系,正如我在下面的回答中提到的)。如果'classNameId'对你的用例不好,我建议尝试在Liferay论坛上发布。 https://web.liferay.com/community/forums –