IntelliJ IDEA 2020.2 Help

Hibernate console tool window

From the Persistence tool window (for a session factory or any node within it):

  • database-openapi.icons.consoleRun.svg on the title bar

  • Console from the context menu

  • Ctrl+Shift+F10

See also, Work with the Hibernate console.

Toolbar icons and shortcuts

Most of the functions in the Hibernate Console tool window are accessed by means of the toolbar icons and associated keyboard shortcuts.

the Execute button Execute QueryCtrl+Enter Run the current query.
icon sqlCopyQuery png Generate SQL Ctrl+Shift+Enter Generate an SQL equivalent of the current query.

The generated SQL statement will be shown in the output pane.

Generate Script Generate SQL/Generate DDL Ctrl+Alt+Shift+Enter

Generate DDL SQL statements CREATE TABLE, ALTER TABLE and DROP TABLE for all the objects (classes) associated with the corresponding session factory.

The generated statements will be shown in the output pane.

Browse Data Source HistoryCtrl+Alt+E

Open a dialog that shows all the queries that you have run in the console.

See also, Running auto-memorized queries.

Settings Settings Open the Database page of the Settings dialog to view or edit the settings for the database, Hibernate and JPA consoles, data editors, and the Database tool window.
View Parameters View Parameters Open or close the Parameters dialog.
Restore Layout Restore Layout Restore the original tool window layout after layout changes.
Cancel Query Terminate Process Ctrl+F2 Terminate execution of the current query.
Close Close Ctrl+Shift+F4 Close the console.

Output pane

Use the Output tab to view information about queries that ran in IntelliJ IDEA. Also, the Output tab displays errors.

The Ouput tab

Right toolbar

Soft-wrapWrap long lines of text.
Scroll to endScroll the output log to the end.
PrintPrint a query console file, a selected text, or all the files in a directory.
Clear allClear the Output tab.

Context menu

Copy CopyCopy the selected text.
Copy as Plain TextCopy the selected text as plain text (without formatting).
Copy ReferenceCopy a reference link to a file or a line.
Compare with clipboard Compare with clipboardOpen the Clipboard vs Editor dialog where you can see the diff between the selected text and the text that you copied to a clipboard.
Search with GoogleOpen a browser and run a search on Google for the selected text.
Fold Lines Like ThisFold the lines that include the selected text.
Pause OutputPause the output logging.
Clear AllClear the output log.

Result pane

This pane shows the data retrieved from the database in table format. You can sort the data as well as perform other, associated tasks.

Most of the functions in the Result pane are accessed by using controls on the toolbar, context menu commands for the data cells, and associated keyboard shortcuts. You can see what other actions with tables you can perform in Tables.

First page, Previous page, Next page, Last page

Use navigation icons and corresponding commands for switching between pages that show the retrieved data.

A number of rows that you see simultaneously on the Result tab are referred to as a result set page. If this number is less than the number of rows that satisfy the query, only a subset of all the rows is shown at a time. If all the rows are currently shown, navigation icons and the corresponding commands are inactive.

  • First page: jump to the first page of results.

  • Previous page: go to the previous page of results.

  • Next page: go to the next page of results.

  • Last page: jump to the last page of results.

To change the size of a result set page, open settings (Ctrl+Alt+S) and navigate to Tools | Database | Data Views. In the Limit page size to field, type a new size of a result set page. Alternatively, to disable the page size restriction, clear the Limit page size to checkbox.

Reload page Reload Page Ctrl+F5

Reload data for the table view to synchronize the data that you see in the editor with the contents of the database. Also, use the Reload Page button when you want to apply a new page size limit setting after its change.

Data Extractor Data Extractor

Select an output format for your data.

Also, you can configure the following options:

  • Skip Computed Columns (SQL): do not include virtual columns that are not physically stored in the table (for example, the identity column).

  • Skip Generated Columns (SQL): for INSERT and UPDATE statements, do not include auto-increment fields when copying or saving data.

  • Add Table Definition (SQL): for INSERT and UPDATE statements, add the table definition when copying or saving data.

  • Configure CSV Formats: open the CSV Formats dialog where you can manage your delimiter-separated values formats (for example, CSV, TSV).

  • Go to Scripts Directory: open a directory with scripts that convert table data into different output formats.

Copy All To Clipboard / Save All To File
  • Copy All To Clipboard. Use this command to copy the table data onto the clipboard.

  • Save All To File. Use this command to save the table data in a file. In the dialog that opens, specify the location and name of the file.


  • The data extractor which is currently active is applied.

  • If only a subset of corresponding rows is currently shown, all the appropriate rows are copied to the clipboard or saved in a file anyway. (The number of rows currently shown may be limited by the Result set page size parameter.)

Save LOB Save a binary large object (LOB) currently selected in the table in a file.
Reset View Use this command to restore the initial table view after reordering or hiding the columns, or sorting the data. As a result, the data, generally, becomes unsorted, the columns appear in the order in which they were defined initially, and all the columns are shown.
View Query Use this button to view the query which was used to generate the table. To close the pane where the query is shown, press Escape.
Go To | Row Ctrl+G Jump to a specified row. In the Go to Row dialog, specify the column and row number (use the column:row pattern).

Using the header row. In the Result pane, you can use the cells in the header row (i.e. the row where column names are shown) for:

To sort table data in a column, click the corresponding cell in the header row. You can click several header row cells to sort table data on multiple columns.

No sortingIndicates that the data is not sorted in this column. The initial state of the sorting marker.
Ascending orderThe data is sorted in the ascending order. The number to the right of the marker (1 on the picture) is the sorting level. You can sort by more than one column. In such cases, different columns will have different sorting levels.
Descending orderThe data is sorted in the descending order.

Here is an example of a table where data are sorted by two of its columns.

TableEditorSortedTable png

To restore the initial "unsorted" state for the table, click IconDBToolbarMenu png and select Reset View.

To reorder columns, use drag-and-drop for the corresponding cells in the header row.

Reordering columns

To hide a column, right-click the corresponding header cell and select Hide column.

  • Right-click any of the cells in the header row and select Column List. Alternatively, press Ctrl+F12.

  • Select the hidden column and press Ctrl+F12

  • To hide a column, right-click the corresponding header cell and select Hide column.

    To show a hidden column:

    1. Do one of the following:
      • Right-click any of the cells in the header row and select Column List.

      • Press Ctrl+F12.

      In the list that appears, the names of hidden columns are shown struck through.

      TableResultPaneHideColumn png
    2. Select (highlight) the column name of interest and press Space.

    3. Press Enter or Escape to close the list.

    To show all the columns, click IconDBToolbarMenu png and select Reset View.

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

    Parameters pane

    The Parameters pane shows the parameters detected in the input pane and lets you edit their values. To open or close this pane, use property yellow png on the toolbar.

    Parameter values can be specified just as text or numbers, or as Groovy expressions that contain object references and method calls. For example, the value for the date parameter in the query

    SELECT o FROM Order o WHERE > :date

    could be specified as

    new java.sql.Date(System.currentTimeMillis() - 24*3600*1000)

    To start editing a value, switch to the corresponding table cell and start typing. To indicate that you have finished editing a value, press Enter or switch to a different cell. To quit the editing mode and restore an initial value, press Escape.

    When you select a row in the table, the corresponding parameter is highlighted in the input pane.

    Last modified: 03 September 2020