IntelliJ IDEA 14.0.0 Web Help

Working with the Hibernate console

Use the Hibernate console to write and run HQL queries, analyze the query results, and also to perform other, associated tasks.

See also, Hibernate Console Tool Window.

Opening the Hibernate console

  1. Open the Persistence tool window ( View | Tool Windows | Persistence or Persistence in the lower part of the left-hand tool window bar).
  2. Expand the Hibernate facet node.
  3. Select the session factory for which you want to open the console or any node within that session factory.
  4. Do one of the following:
    • Click ConsoleOnTitleBar on the title bar.
    • Select Console from the context menu.
    • Press Ctrl+Shift+F10.
    openHibernateConsole

Viewing and modifying the console settings

  • To access these settings, click settings on the toolbar of the Hibernate Console tool window.

Composing HQL queries

Navigating to the declaration of a class or field

Running a query

Running parameterized queries

Running auto-memorized queries

Terminating query execution

Generating SQL statements and DDL SQL scripts

Hiding or showing the Result pane toolbar

  • Click viewMode on the title bar of the Hibernate Console tool window and click Show Toolbar.

Pinning the Result tab

  • Right-click the tab and select Pin Tab.
    HConsoleResultPinTab

Navigating through subsets of rows

Making all rows visible simultaneously

  1. Click settings on the toolbar of the Hibernate Console tool window.
  2. On the Database page that opens, specify 0 in the Result set page size field, and click OK.
  3. Click refresh or press Ctrl+R to refresh the table view.

Navigating to a specified row

  1. Do one of the following:
    • Press Ctrl+G.
    • Right-click the table and select Go To | Row from the context menu.
    • Select Navigate | Row from the main menu.
  2. In the dialog that opens, specify the row number and click OK.

Sorting data

Reordering columns

Hiding and showing columns

Restoring the initial table view

Using the Structure view to sort data, and hide and show columns

Copying a table to the clipboard or saving table in a file

  1. Do one of the following:
    • Click copyOpen on the toolbar and select Copy All To Clipboard or Save All To File.
    • Right-click the table and select Copy All To Clipboard or Save All To File from the context menu.
  2. If you are saving the table in a file, specify the file name and location.

Changing table output format

  1. Do one of the following:
    • Click DataExtractorButton on the toolbar.
    • Right-click the table and point to Data Extractor: <extractor_name> in the context menu.
  2. Do one of the following:
    • To make a different extractor active, click the name of the desired extractor.
    • To create a new extractor, or to view or modify the settings for an existing extractor, click Configure Extractors. As a result, the Data Extractors dialog will open.

Saving a LOB in a file

  1. Right-click the cell that contains the LOB of interest and select Save LOB To File.
  2. In the dialog that opens, specify the name and location of the destination file and click OK.

Updating the table view

Viewing the query

Closing the console

See Also

Last modified: 4 December 2014
comments powered by Disqus