Reputation: 63
I have installed the plugin:
and dependency:
But when I use IDEA to build entity, it will like this:
I want to replace getter and setter by @Getter,@Setter when IDEA build it automatically.
Upvotes: 6
Views: 1952
Reputation: 59
You can use pojo generator plugin https://plugins.jetbrains.com/plugin/12297-pojo-generator ,after add @Data annotation
Upvotes: 0
Reputation: 30482
You can use just @Data
Lombok annotation with your entities, for example:
@Data
@Entity
public class MyEntity {
@Id
private Long id;
@Column(lenght = 16, nullable = false)
private String someField;
}
In this case you get your entity with automatically created getters, setters, default constructor (without parameters), equals
, hashCode
and toString
methods.
Upvotes: 2