Constructore Generator Issue - @GeneratedValue

已回答

Hi All,

I shift recently to IntelliJIDEA from STS.

I tried to generate the constructor using the default code generator, but it seems the field which annotated by :

@GeneratedValue(strategy = GenerationType.IDENTITY)

would get bypassed by the code generator and cant generate the constructore for it!

0

Hi.

Please provide exact steps to reproduce a problem.

0

I can not use Alt+Insert -> Constructor  to create a constructor for below class:

public class BaseEntity {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

something like:

public BaseEntity(Long id) {
this.id = id;
}

or even someting like:

public BaseEntity(Long id,
String test) {
this.id = id;
this.test = test;
}

the id field wont be suggested as it get annotated by

@GeneratedValue(strategy = GenerationType.IDENTITY)
0

Try Code | Generate | Constructor,

0

请先登录再写评论。