基于Java对象创建JPA 映射:Java2JPA

jopen 12年前

Java2JPA 是一个 Java 类库,能够很方便的基于 Java 对象来创建 JPA 映射。

示例代码:

Java2JpaMappingGenerator java2JpaMappingGenerator = new Java2JpaMappingGenerator();   java2JpaMappingGenerator.setRenderJpaMappingForClassStrategy( new RenderJpaMappingForClassStrategyDefaultImpl());   JpaMappingRendererDefaultImpl jpaMappingRenderer = new JpaMappingRendererDefaultImpl("target/META-INF/orm.xml");   java2JpaMappingGenerator.setJpaMappingRenderer(jpaMappingRenderer);   java2JpaMappingGenerator.generateJpaMappingsForPackages("com.test.model");   jpaMappingRenderer.createMappedFiles();

项目主页:http://www.open-open.com/lib/view/home/1366078612343