I want to create another autogenerated field in my class.
I followed开发者_开发百科 this unanswered question - with no successhttps://stackoverflow.com/questions/4930762/generate-an-auto-generated-value-of-a-field-under-java-hibernate-id-generatedv
I need even a more simple thing - I want my second field - to receive the same value as the @ID @AutoGenerated. Is there a way to do that?
As an example try like this.
@GeneratedValue(strategy = IDENTITY)
@Column(name = "columnName", unique = true, nullable = false, insertable = false, updatable = false)
private Integer columnName;
精彩评论