How can I create a ddl for my jpa entities from java code?

前端 未结 5 944
伪装坚强ぢ
伪装坚强ぢ 2021-02-11 08:15

I look for a way how I can create a ddl for my jpa annotated entities. I prefer a pure java way for this.

If possible it would be nice to have generate the drop statemen

5条回答
  •  再見小時候
    2021-02-11 08:50

    OpenJPA has support for this too. The OpenJPA mapping tool can create a script or create a ddl file. The ddl should work with other JPA implementations (although each vendor has a few quirks).

    If you're using OpenJPA as a persistence provider you can configure OpenJPA to create the tables the first time they're needed by adding the SynchronizeMappings property to persistence.xml.

    Example :

     
        
        
            
        
        
    
    

提交回复
热议问题