netbeans jpa从数据库定制实体生成 [英] netbeans jpa customize entity generation from database
问题描述
我想在我的EE项目中使用现有的活动oracle数据库。我试图找到一种从这个数据库生成实体类的方法,包含140多个表和许多关系。
I want to use existing active oracle database in my EE project. I try to find a way to generate entity classes from this database with more than 140 tables and many many relations.
我在Netbeans和eclipse中尝试了很多生成器向导,但结果不符合我的自定义要求。 NB JPA-Modeler
插件是我用过的好工具,但我需要特定的自定义配置来自动生成实体,因为我不需要对图中的每个类/表进行任何手动更改。
I tried many generator wizards in Netbeans and eclipse but the result does not fit my customization requirements. NB JPA-Modeler
plugin is good tool I've used but i need specific custom config to automate entity generation as i need, without any manual changes for each class/table in diagram.
例如类型映射自定义类似于: NUMBER(1) - > Boolean或NUMBER(15) - > Long
依此类推......
For example type mapping customization for something like: NUMBER(1)->Boolean or NUMBER(15)->Long
and so on...
推荐答案
我建议您尝试使用minuteproject for the track JPA2 。
它管理多对多,一对多,多对一的关系。
I suggest you to try minuteproject for the track JPA2. It manages many-to-many, one-to-many, many-to-one relationships.
它在模型级别捆绑了许多自定义(名称为实体,列,关系)通过全球公约或实体/列中心浓缩。
它目前没有与类型映射相关的约定关系,可以通过发送提案/在(minuteproject@googlegroups.com)开启讨论来开发。
It bundles many customisation at model level (name of entities, columns, relationships) done via global conventions or entity/column centric enrichment. It does not have for the moment convention relation related to type mappings, those could be developed via sending a proposal/opening a discussion at (minuteproject@googlegroups.com).
同时,所需的两个映射配置(NUMBER(1) - > Boolean或NUMBER(15) - > Long)应对应于默认的映射行为。
Meanwhile the two mapping configuration required (NUMBER(1)->Boolean or NUMBER(15)->Long) should correspond to the default mapping behavior.
这篇关于netbeans jpa从数据库定制实体生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!