0

I have one column in my Entity Class like :

@Column(name = "createdBy", nullable = false)

private String createdBy;

Later i need to update column name.

Is there any way to update the column name using hibernate annotation which will not generate new column.

9
  • It is really not clear what you are asking Commented Sep 5, 2018 at 14:08
  • I want to update the name of column using hibernate annotation. Commented Sep 5, 2018 at 14:09
  • Probably you could just rename column in your database and then change annotation value. Commented Sep 5, 2018 at 14:09
  • 1
    hibernate.hbm2ddl.auto=update should do the Job if my understanding is correct Commented Sep 5, 2018 at 14:11
  • @AnarSultanov any other way except like : ALTER TABLE "table_name" Change "column 1" "column 2" ["Data Type"]; Commented Sep 5, 2018 at 14:11

1 Answer 1

0

Nope. You should use annotation and SQL script to modify table.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.