java根据数据库创建实体,从数据库自动创建实体

Is there a way to automatically create javax.persistence.Entity classes from an existing database (or from the SQL statements that created them)?

I am just reading through the persistence part of The Java EE 5 Tutorial and creating all these annotations by hand seems rather wasteful considering that all (or most) of the necessary knowledge is already encoded in the database or even explicitly given in the form of SQL statements.

解决方案

There are several attemps to reverse engineer databases to create entity classes, one of the first google results show this blog, but you can find quite a lot information.

Also if you are going to use hibernate, check for ddl2hbm tools, what basically is the very same idea.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值