java - Change from @Enumerated to @Enumerated(EnumType.STRING) on database -


i have annotation @enumerated on fields in application thats working. told change @enumerated(enumtype.string) prevent problems if enum values change. database populated, question is

what way change values on database 1,2,3.. corresponding string values of enum class?

if asking how can maintain values , change db think have in few steps(the basic algorithm switch values):

  1. add new column table numerical.
  2. copy values column new one.
  3. delete content of column
  4. alter table make string column
  5. copy values column original one.

this detailed , not sure if asking...


Comments

Popular posts from this blog

javascript - Count length of each class -

What design pattern is this code in Javascript? -

hadoop - Restrict secondarynamenode to be installed and run on any other node in the cluster -