开发者

How to generate orm mapping classes from sql schema in Java

I have an existing sql schema file for db. Is it possible to generate and re-genera开发者_开发问答te when needed DAO's entities and all other required helper/client classes to access it? I don't mind what will it be -- hibernate, other jpa or something else.


Asuming you/others are still looking for a solution:

I just got the same problem and got it working in Eclipse (slightly different) as follows:

  1. created JPA Project and downloaded & added user library in the wizard
  2. Also wanted to give a schema-sql-file as input but instead found a way to take an actual db as input. (That was surely much easier for the developers of the tool to process than parsing proprietary sql-script-files)
  3. To do that "rightclick" you jpa project an there "new/other/jpa/entities from tables"
  4. In the following Wizard you have to create a db-connection to the db whose schema you want to get as jpa-annotated POJOs (IMHO It's very intuitive..but you may ask if there is a problem)

  5. After finishing all jpa-classes are generated from the db...saved me from a lot of dummy work :)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜