Generate code
Code | Generate or AltInsert
Configure: CtrlAlt0S Settings | Editor | File and Code Templates
DataGrip provides multiple ways to generate common code constructs and recurring elements, which helps you increase productivity. These can be either file templates used when creating a new file, custom or predefined live templates that are applied differently based on the context, various wrappers, or automatic pairing of characters.
Go to Code | Generate AltInsert to open the popup menu with available constructs that you can generate.
You can generate the following database entities: function, procedure, index, rule, trigger, view, materialized view, schema, database, role, user, sequence, enum, domain, composite type, foreign table, aggregate, operator, collation, foreign data wrapper, access method, extension table.
Click Code | Generate or press AltInsert.
Select the entity that you want to generate and press Enter.
To store point objects in the database by using JPA, you must define an entity class. A JPA entity class is a Java class that is annotated as having the ability to represent objects in the database (a POJO (Plain Old Java Object) class).
You can select the necessary tables and views and generate corresponding JAVA files.
Right-click a database object for which you want to generate a Java entity class and navigate to Tools | Scripted Extensions | Generate POJOs.groovy.
In the file browser, specify the directory where you want to store JAVA class files
Example of a generated Java entity class:
package com.sample;
{...}
Thanks for your feedback!