开发者

How to add fields to EJB CMP entity bean automatically?

We have a data model that contai开发者_JAVA技巧ns large amount of columns in few key tables. Now I'd need to add corresponding mappings for them to EJB 3.x CMP entity beans. Because column name (on DB) and Java-side name (used on private field and getter/setter) are the only things that change, ideally I would just give those two to each fields on two-column table, press "OK" and some program would fill in the rest.

So, what is the closest I can get to this?

As a source material I have DB schema as MySQL CREATE TABLEs and EJB 2.1 entity beans, if those would be of use.


I assume you mean EJB 3 JPA not CMP, as JPA has repalced CMP in EJB 3.

There are many tools that support JPA that can generate entity classes from table or auto-map them, consider using Eclipse Dali, or Oracle JDeveloper, or Netbeans.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜