Unknown entity: com.liferay.asset.entry.rel.model.AssetEntryAssetCategoryReUnknown entity: com.liferay.asset.entry.rel.model.AssetEntryAssetCategoryRehttps://liferay.dev/c/message_boards/find_thread?p_l_id=119785333&threadId=1216382292024-03-29T00:24:36Z2024-03-29T00:24:36ZUnknown entity: com.liferay.asset.entry.rel.model.AssetEntryAssetCategoryReFabio Orjuela Diazhttps://liferay.dev/c/message_boards/find_message?p_l_id=119785333&messageId=1216382282023-01-31T21:31:10Z2023-01-31T00:14:34Z<p>Hi,</p>
<p>I am trying to use the table <strong>ASSETENTRYASSETCATEGORYREL
</strong>in my code, and I found that there exists a dependency to use
the class <strong>AssetEntryAssetCategory</strong>. But, when I want
to do a DynamicQuery, this message is appearing in the log file: </p>
<p>org.hibernate.MappingException: Unknown entity: com.liferay.asset.entry.rel.model.AssetEntryAssetCategoryRel.</p>
<p>These are the dependencies which I am using in my build.gradle:</p>
<p>dependencies {<br /> compileOnly group: "com.liferay",
name: "com.liferay.petra.io"<br /> compileOnly group:
"com.liferay", name:
"com.liferay.petra.lang"<br /> compileOnly group:
"com.liferay", name:
"com.liferay.petra.string"<br /> compileOnly group:
"com.liferay", name:
"com.liferay.portal.aop.api"<br /> compileOnly group:
"com.liferay.portal", name:
"com.liferay.portal.kernel"<br /> <strong>compileOnly
group: 'com.liferay.portal', name: 'release.portal.api', version: '7.1.1'</strong>
<br /> compileOnly group: 'com.liferay', name:
'com.liferay.journal.api'<br /> compileOnly group: 'com.liferay',
name: 'com.liferay.knowledge.base.api'<br /> compileOnly group:
"org.osgi", name:
"org.osgi.annotation.versioning"<br /> compileOnly
group: "org.osgi", name: "org.osgi.core"<br />
compileOnly group: "org.osgi", name:
"org.osgi.service.component.annotations"<br /> }</p>
<p>And this is the code which I am trying to execute:</p>
<p>DynamicQuery q =
DynamicQueryFactoryUtil.forClass(<strong>AssetEntryAssetCategoryRel</strong>.class,
PortalClassLoaderUtil.getClassLoader())<br />
.add(RestrictionsFactoryUtil.eq("assetEntryAssetCategoryRelId",
articleId));<br />
List<<strong>AssetEntryAssetCategoryRel</strong>>
entryCategoryRel =
<strong>AssetEntryAssetCategoryRelLocalServiceUtil</strong>.dynamicQuery(q);<br />
if (entryCategoryRel != null) {<br /> for
(<strong>AssetEntryAssetCategoryRel </strong>item :
entryCategoryRel) {<br /> logger.info("
item.getAssetCategoryId() = " +
item.getAssetCategoryId());<br /> }<br /> }</p>
<p>Thanks for your attention.</p>Fabio Orjuela Diaz