How IntelliJ IDEA File Templates made my life easier as a developer.

Keep in mind, that you can use these instructions on other JetBrains IDE’s
“WebStorm, PyCharm, RubyMine etc.”

public class MyAwesomeEntity {

@Column(length = 36, columnDefinition = "varchar(36)", updatable = false, nullable = false)
@Type(type = "org.hibernate.type.UUIDCharType")
private UUID id;

@Column(updatable = false)
private Timestamp createdDate;
private Timestamp lastModifiedDate;


Now, to stop reproducing this code from scratch over and over again we can just press :
- Double SHIFT (Search everywhere)
- Search: “Save File as template”
- Give it the name “MyAwesomeEntity”
And then hit

Double “Shift” in IntelliJ IDEA
Creating a File Template

Here’s how we use the file template:
- Open Project tool Window
(Mac -> cmd+1 or Windows -> alt+1)
- Right click on the package that you want to create the entity
- Choose Java Class
- Give it a name “MyAwesomeEntityReused”
Choose the template “MyAwesomeEntity”
- Press

Using a File Template



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store