<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title>How search  DLFileEntry/DLFileVersion with specific metadata values?</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=113121840" />
  <subtitle>How search  DLFileEntry/DLFileVersion with specific metadata values?</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=113121840</id>
  <updated>2026-04-04T08:58:58Z</updated>
  <dc:date>2026-04-04T08:58:58Z</dc:date>
  <entry>
    <title>RE: How search  DLFileEntry/DLFileVersion with specific metadata values?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113183031" />
    <author>
      <name>Marco Azzalini</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113183031</id>
    <updated>2019-04-12T07:48:57Z</updated>
    <published>2019-04-12T07:48:57Z</published>
    <summary type="html">&lt;blockquote&gt;Jorge DíazHi Marco,&lt;br /&gt;&lt;br /&gt; com.liferay.portlet.documentlibrary.model.impl.DLFileEntryMetadataImpl extends com.liferay.portlet.documentlibrary.model.impl.DLFileEntryMetadataModelImpl&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I have checked that class and it seems property is called &lt;strong&gt;DDMStorageId&lt;/strong&gt;,  with DDM in uppercase, see:&lt;ul style="list-style: disc outside;"&gt;&lt;li&gt;&lt;a href="https://github.com/liferay/liferay-portal/blob/7.1.x/portal-impl/src/com/liferay/portlet/documentlibrary/model/impl/DLFileEntryMetadataModelImpl.java#L66-L71"&gt;https://github.com/liferay/liferay-portal/blob/7.1.x/portal-impl/src/com/liferay/portlet/documentlibrary/model/impl/DLFileEntryMetadataModelImpl.java#L66-L71&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Can you try using that property name?&lt;br /&gt;&lt;br /&gt;I hope that solves your problem, as I am running out of ideas.&lt;br /&gt;&lt;br /&gt;In case that doesn&amp;#39;t solve your issue, can you attach your whole log file with the error?&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jorge Díaz&lt;/blockquote&gt;Jorge, with DDMStorageId it works!!&lt;br /&gt;&lt;br /&gt;I think this should be definly better documented, but thank you very much for all your support! &lt;br /&gt;&lt;br /&gt;regards,&lt;br /&gt;Marco</summary>
    <dc:creator>Marco Azzalini</dc:creator>
    <dc:date>2019-04-12T07:48:57Z</dc:date>
  </entry>
  <entry>
    <title>RE: How search  DLFileEntry/DLFileVersion with specific metadata values?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113148062" />
    <author>
      <name>Jorge Diaz</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113148062</id>
    <updated>2019-04-11T13:51:29Z</updated>
    <published>2019-04-11T13:51:29Z</published>
    <summary type="html">Hi Marco,&lt;br /&gt;&lt;br /&gt; com.liferay.portlet.documentlibrary.model.impl.DLFileEntryMetadataImpl extends com.liferay.portlet.documentlibrary.model.impl.DLFileEntryMetadataModelImpl&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I have checked that class and it seems property is called &lt;strong&gt;DDMStorageId&lt;/strong&gt;,  with DDM in uppercase, see:&lt;ul style="list-style: disc outside;"&gt;&lt;li&gt;&lt;a href="https://github.com/liferay/liferay-portal/blob/7.1.x/portal-impl/src/com/liferay/portlet/documentlibrary/model/impl/DLFileEntryMetadataModelImpl.java#L66-L71"&gt;https://github.com/liferay/liferay-portal/blob/7.1.x/portal-impl/src/com/liferay/portlet/documentlibrary/model/impl/DLFileEntryMetadataModelImpl.java#L66-L71&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;br /&gt;Can you try using that property name?&lt;br /&gt;&lt;br /&gt;I hope that solves your problem, as I am running out of ideas.&lt;br /&gt;&lt;br /&gt;In case that doesn&amp;#39;t solve your issue, can you attach your whole log file with the error?&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jorge Díaz</summary>
    <dc:creator>Jorge Diaz</dc:creator>
    <dc:date>2019-04-11T13:51:29Z</dc:date>
  </entry>
  <entry>
    <title>RE: How search  DLFileEntry/DLFileVersion with specific metadata values?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113138031" />
    <author>
      <name>Marco Azzalini</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113138031</id>
    <updated>2019-04-11T11:32:09Z</updated>
    <published>2019-04-11T11:32:09Z</published>
    <summary type="html">No, never tried before...&lt;br /&gt;&lt;br /&gt;but same result  :-(&lt;br /&gt;&lt;br /&gt;SystemException: org.hibernate.QueryException: could not resolve property: ddmStorageId of: com.liferay.portlet.documentlibrary.model.impl.DLFileEntryMetadataImpl</summary>
    <dc:creator>Marco Azzalini</dc:creator>
    <dc:date>2019-04-11T11:32:09Z</dc:date>
  </entry>
  <entry>
    <title>RE: How search  DLFileEntry/DLFileVersion with specific metadata values?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113135285" />
    <author>
      <name>Jorge Diaz</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113135285</id>
    <updated>2019-04-11T10:50:35Z</updated>
    <published>2019-04-11T10:50:35Z</published>
    <summary type="html">Did you tried using camel case in the property name?&lt;br /&gt;&lt;br /&gt;I mean to use &amp;#34;ddmStorageId&amp;#34; instead of  &amp;#34;ddmstorageid&amp;#34;</summary>
    <dc:creator>Jorge Diaz</dc:creator>
    <dc:date>2019-04-11T10:50:35Z</dc:date>
  </entry>
  <entry>
    <title>RE: How search  DLFileEntry/DLFileVersion with specific metadata values?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113134723" />
    <author>
      <name>Marco Azzalini</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113134723</id>
    <updated>2019-04-11T10:35:35Z</updated>
    <published>2019-04-11T10:35:35Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi Jorge, I did what you suggested me and now my code is:&lt;br&gt;&lt;pre&gt;&lt;code&gt;q=DLFileEntryMetadataLocalServiceUtil.dynamicQuery();
q.add(PropertyFactoryUtil.forName("ddmstorageid").in(ddmContentsIdsArray));
List&amp;lt;dlfileentrymetadata&amp;gt; fileEntryMetadataList= DLFileEntryMetadataLocalServiceUtil.dynamicQuery(q);&amp;lt;/dlfileentrymetadata&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;but the same exception is raised :-(&lt;br&gt;I did also more investigation and the error occours with any property so I am agree with you that the problem could be something related with class loading but I really can't figure out &amp;nbsp;what difference could be between DDMContent (where the same query run smootly) and DLFileentryMetadata ...&lt;br&gt;&lt;br&gt;This is really weird...&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Marco Azzalini</dc:creator>
    <dc:date>2019-04-11T10:35:35Z</dc:date>
  </entry>
  <entry>
    <title>RE: How search  DLFileEntry/DLFileVersion with specific metadata values?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113131694" />
    <author>
      <name>Jorge Diaz</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113131694</id>
    <updated>2019-04-11T07:57:59Z</updated>
    <published>2019-04-11T07:57:59Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi Marco,&lt;br&gt;&lt;br&gt;I think you have some problem with classloaders. &lt;br&gt;See following link: &lt;a href="https://community.liferay.com/forums/-/message_boards/message/98752117#_com_liferay_message_boards_web_portlet_MBPortlet_message_92981243"&gt;https://community.liferay.com/forums/-/message_boards/message/98752117#_com_liferay_message_boards_web_portlet_MBPortlet_message_92981243&lt;br&gt;&lt;br&gt;&lt;/a&gt;&lt;br&gt;Try replacing &lt;strong&gt;&lt;em&gt;DynamicQueryFactoryUtil.forClass({className}.class)&lt;/em&gt;&lt;/strong&gt; with&lt;br&gt;&lt;pre&gt;&lt;code&gt;{className}LocalServiceUtil.dynamicQuery()&lt;/code&gt;&lt;/pre&gt;That will avoid classloader issues&lt;br&gt;&lt;br&gt;For examine, in case of DLFileEntryMetadata, replace &lt;em&gt;&lt;strong&gt;DynamicQueryFactoryUtil.forClass(DLFileEntryMetadata.class)&lt;/strong&gt;&lt;/em&gt; with:&lt;br&gt;&lt;pre&gt;&lt;code&gt;DLFileEntryMetadataLocalServiceUtil.dynamicQuery()&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;More info see:&lt;br&gt;&lt;ul style="list-style: disc outside;"&gt;&lt;li&gt;&lt;a href="https://web.liferay.com/community/forums/-/message_boards/message/90747545"&gt;https://web.liferay.com/community/forums/-/message_boards/message/90747545&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://web.liferay.com/community/forums/-/message_boards/message/90746976"&gt;https://web.liferay.com/community/forums/-/message_boards/message/90746976&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Jorge Diaz</dc:creator>
    <dc:date>2019-04-11T07:57:59Z</dc:date>
  </entry>
  <entry>
    <title>RE: How search  DLFileEntry/DLFileVersion with specific metadata values?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113130526" />
    <author>
      <name>Marco Azzalini</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113130526</id>
    <updated>2019-04-11T07:06:45Z</updated>
    <published>2019-04-11T07:06:45Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;blockquote&gt;Jorge DíazHi Marco,&lt;br&gt;&lt;br&gt;DLFileEntry metadata is not stored in same table, so it is not possible to do that dynamic query.&lt;br&gt;&lt;br&gt;You can query the search index or you have to query the tables were data is stored.&lt;br&gt;&lt;br&gt;More information see following links:&lt;br&gt;&lt;ul style="list-style: disc outside;"&gt;&lt;li&gt;&lt;a href="https://community.liferay.com/forums/-/message_boards/view_message/90731233"&gt;https://community.liferay.com/forums/-/message_boards/view_message/90731233&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://community.liferay.com/forums/-/message_boards/view_message/30782428"&gt;https://community.liferay.com/forums/-/message_boards/view_message/30782428&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://community.liferay.com/forums/-/message_boards/message/90713583"&gt;https://community.liferay.com/forums/-/message_boards/message/90713583&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://community.liferay.com/forums/-/message_boards/message/27159995"&gt;https://community.liferay.com/forums/-/message_boards/message/27159995&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/blockquote&gt;&lt;br&gt;&lt;br&gt;Hi Jorge, thank you very much for your suggestions. Unfortunately that field is not indexed so I can't use the the indexer.&lt;br&gt;Another approach I am trying is to query the ddmcontent.xml column where the metadata are stored, this works fine and I am able to get the ddmContent ids but my second query on DLFileEntryMetadata:&lt;br&gt;&lt;br&gt;&lt;pre&gt;&lt;code&gt;DynamicQuery q=DynamicQueryFactoryUtil.forClass(DLFileEntryMetadata.class);
q.add(PropertyFactoryUtil.forName("ddmstorageid").in(ddmContentsIdsArray));
List&amp;lt;dlfileentrymetadata&amp;gt; fileEntryMetadataList= DLFileEntryMetadataLocalServiceUtil.dynamicQuery(q);&amp;lt;/dlfileentrymetadata&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;br&gt;fails raising this exception (??)&lt;br&gt;&lt;br&gt;org.hibernate.QueryException: could not resolve property: &lt;strong&gt;ddmstorageid&lt;/strong&gt; of: com.liferay.portlet.documentlibrary.model.impl.DLFileEntryMetadataImpl&lt;br&gt;&lt;br&gt;Do you have any idea why the ddmstorageid property is not found?&lt;br&gt;&lt;br&gt;My last chance could be process a large bunch of FileVersions and analyze their FieldMaps but I would really prefer to be able to make Database engine do the work for me ;-)&lt;br&gt;​​​​​​​&lt;br&gt;&lt;br&gt;regards,&lt;br&gt;Marco&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Marco Azzalini</dc:creator>
    <dc:date>2019-04-11T07:06:45Z</dc:date>
  </entry>
  <entry>
    <title>RE: How search  DLFileEntry/DLFileVersion with specific metadata values?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113123291" />
    <author>
      <name>Jorge Diaz</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113123291</id>
    <updated>2019-04-10T16:04:11Z</updated>
    <published>2019-04-10T16:04:11Z</published>
    <summary type="html">Hi Marco,&lt;br /&gt;&lt;br /&gt;DLFileEntry metadata is not stored in same table, so it is not possible to do that dynamic query.&lt;br /&gt;&lt;br /&gt;You can query the search index or you have to query the tables were data is stored.&lt;br /&gt;&lt;br /&gt;More information see following links:&lt;br /&gt;&lt;ul style="list-style: disc outside;"&gt;&lt;li&gt;&lt;a href="https://community.liferay.com/forums/-/message_boards/view_message/90731233"&gt;https://community.liferay.com/forums/-/message_boards/view_message/90731233&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://community.liferay.com/forums/-/message_boards/view_message/30782428"&gt;https://community.liferay.com/forums/-/message_boards/view_message/30782428&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://community.liferay.com/forums/-/message_boards/message/90713583"&gt;https://community.liferay.com/forums/-/message_boards/message/90713583&lt;/a&gt;&lt;/li&gt;&lt;li&gt;&lt;a href="https://community.liferay.com/forums/-/message_boards/message/27159995"&gt;https://community.liferay.com/forums/-/message_boards/message/27159995&lt;/a&gt;&lt;/li&gt;&lt;/ul&gt;</summary>
    <dc:creator>Jorge Diaz</dc:creator>
    <dc:date>2019-04-10T16:04:11Z</dc:date>
  </entry>
  <entry>
    <title>How search  DLFileEntry/DLFileVersion with specific metadata values?</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113121839" />
    <author>
      <name>Marco Azzalini</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=113121839</id>
    <updated>2019-04-10T15:18:42Z</updated>
    <published>2019-04-10T15:18:42Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hi, I have a text field in my custom type that it is not indexed.&lt;br&gt;Is it possible to issue a query (Dynamic query) based on that field?&amp;nbsp;&lt;br&gt;&lt;br&gt;I mean something similar to this (pseudo-)code:&lt;br&gt;&lt;pre&gt;&lt;code&gt;DynamicQuery q=DynamicQueryFactoryUtil.forClass(DLFileVersion.class);
q.add(PropertyFactoryUtil.forName("my-custom-field").like(likeCriteria));
List&amp;lt;dlfileversion&amp;gt; fvList = DLFileVersionLocalServiceUtil.dynamicQuery(q);&amp;lt;/dlfileversion&amp;gt;&lt;/code&gt;&lt;/pre&gt;If not, how can I search for those documents?&lt;br&gt;&lt;br&gt;thanks in advance,&lt;br&gt;Marco&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Marco Azzalini</dc:creator>
    <dc:date>2019-04-10T15:18:42Z</dc:date>
  </entry>
</feed>
