Reverse engineer DDL from JPA entities

后端 未结 8 1451
情歌与酒
情歌与酒 2020-12-08 05:13

I\'m playing around with some JPA stuff, changing the mappings to see how they\'re supposed to be etc. It\'s basic experimentation. However I can\'t find a tool that will si

8条回答
  •  忘掉有多难
    2020-12-08 05:42

    Antonio Goncalves says in his blog about API to generate the schema.
    In JPA 2.1 generateSchema method was introduced for this purpose.

    Example from blog:

    public class Main {
        public static void main(String[] args) {
            Persistence.generateSchema("samplePU", null);
        }
    }
    

提交回复
热议问题