<?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>Custom SQL-Query</title>
  <link rel="self" href="https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119473201" />
  <subtitle>Custom SQL-Query</subtitle>
  <id>https://liferay.dev/c/message_boards/find_thread?p_l_id=119785294&amp;threadId=119473201</id>
  <updated>2026-04-03T23:27:05Z</updated>
  <dc:date>2026-04-03T23:27:05Z</dc:date>
  <entry>
    <title>RE: Custom SQL-Query</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119476278" />
    <author>
      <name>Dominik Marks</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119476278</id>
    <updated>2020-06-24T14:23:49Z</updated>
    <published>2020-06-24T14:23:49Z</published>
    <summary type="html">If you have at least something related to service builder you could make use of the custom-sql functionality (as described here: &lt;a href="https://help.liferay.com/hc/en-us/articles/360017882012-Custom-SQL"&gt;https://help.liferay.com/hc/en-us/articles/360017882012-Custom-SQL&lt;/a&gt;)</summary>
    <dc:creator>Dominik Marks</dc:creator>
    <dc:date>2020-06-24T14:23:49Z</dc:date>
  </entry>
  <entry>
    <title>RE: Custom SQL-Query</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119474750" />
    <author>
      <name>Fredi B</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119474750</id>
    <updated>2020-06-24T09:58:14Z</updated>
    <published>2020-06-24T09:58:14Z</published>
    <summary type="html">Solution for me that worked - but is absolutely not they way that I prefer:&lt;blockquote&gt;Class.forName(&amp;#34;com.mysql.cj.jdbc.Driver&amp;#34;) ;&lt;br /&gt;Connection conn = DriverManager.getConnection(&amp;#34;jdbc:mysql://localhost/.......) ;&lt;br /&gt;            Statement stmt = conn.createStatement() ;&lt;br /&gt;            String query = &amp;#34;select dictionary from configuration_ where configurationId=&amp;#39;PORTLET-NAME&amp;#39;;&amp;#34; ;&lt;br /&gt;            ResultSet rs = stmt.executeQuery(query) ;&lt;br /&gt;            while ( rs.next() ) {&lt;br /&gt;                    String configurationSettings = rs.getString(&amp;#34;dictionary&amp;#34;);&lt;br /&gt;                    System.out.println(configurationSettings);&lt;br /&gt;            }&lt;/blockquote&gt;</summary>
    <dc:creator>Fredi B</dc:creator>
    <dc:date>2020-06-24T09:58:14Z</dc:date>
  </entry>
  <entry>
    <title>Custom SQL-Query</title>
    <link rel="alternate" href="https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119473200" />
    <author>
      <name>Fredi B</name>
    </author>
    <id>https://liferay.dev/c/message_boards/find_message?p_l_id=119785294&amp;messageId=119473200</id>
    <updated>2020-06-24T06:38:23Z</updated>
    <published>2020-06-24T06:38:23Z</published>
    <summary type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;Hey Liferay-Community,&lt;br&gt;So I finally got multiple React-Portlets up and running and they all get their data via REST from my REST-module.&amp;nbsp;&lt;br&gt;&lt;br&gt;In one React-Portlet I am using the &lt;em&gt;configuration.json&lt;/em&gt; to set values in the &lt;em&gt;configuration_&lt;/em&gt;-Table (&lt;em&gt;dictionary&lt;/em&gt;-Column).&lt;br&gt;&lt;br&gt;Is there a simple way how I can access this entry now?&lt;br&gt;&lt;br&gt;Like:&amp;nbsp;&lt;em&gt;SELECT dictionary FROM configuration_ WHERE configurationId = 'NAME-OF-MY-PORTLET'&lt;/em&gt;&lt;em&gt;&lt;/em&gt;&lt;br&gt;&lt;em&gt;&lt;/em&gt;&lt;br&gt;&lt;em&gt;&lt;/em&gt;I stumbled over&amp;nbsp; dynamicQueries but I have no clue how to adapt it to Liferay-Tables?&lt;em&gt;&lt;/em&gt;&lt;br&gt;&lt;blockquote&gt;&lt;pre&gt;&lt;code&gt;DynamicQuery guestbookQuery = DynamicQueryFactoryUtil.forClass(Guestbook.class, classLoader))
    .add(RestrictionsFactoryUtil.eq("name", guestbookName))
    .setProjection(ProjectionFactoryUtil.property("guestbookId"));&lt;/code&gt;&lt;/pre&gt;&lt;/blockquote&gt;&lt;em&gt;&lt;/em&gt;&lt;br&gt;    &lt;br&gt;I just need a simple way to get some configuration-Settings (for example colorCode or title of the section) to my REST-Module.&lt;/body&gt;&lt;/html&gt;</summary>
    <dc:creator>Fredi B</dc:creator>
    <dc:date>2020-06-24T06:38:23Z</dc:date>
  </entry>
</feed>
