Redian新闻
>
Which POJO generator is better?
avatar
Which POJO generator is better?# Java - 爪哇娇娃
m*o
1
All,
I need to modify an old java project to use a new MySQL database. It sounds
simple enough at first, then I found out that the project is currently using
DB2 with all queries hard coded with table and column names. The new
database has different table and column names from the DB2 one. There are
also times when information in one table in DB2 are now in separate tables
in MySQL, or vice versa.
I know that there are actually multiple java projects that are in the same
boat - switching from that old DB2 database to the new MySQL one - so I'm
thinking of creating a data source project that offers all POJO classes for
the MySQL database so it can be used by all the java projects that will need
to be changed in near future.
Any thoughts about the approach? If a separate data source project sounds
like the right choice, which pojo generator is better to use in your
experience?
Big thanks for any input.
avatar
r*s
2
didn't understand what you want: why is it about db migration?
for creating pojos i've used hiternate tools integrated with
eclipse, it's free.
there might be other non-free tools for reverse engineer
db schemas.

sounds
using
for

【在 m******o 的大作中提到】
: All,
: I need to modify an old java project to use a new MySQL database. It sounds
: simple enough at first, then I found out that the project is currently using
: DB2 with all queries hard coded with table and column names. The new
: database has different table and column names from the DB2 one. There are
: also times when information in one table in DB2 are now in separate tables
: in MySQL, or vice versa.
: I know that there are actually multiple java projects that are in the same
: boat - switching from that old DB2 database to the new MySQL one - so I'm
: thinking of creating a data source project that offers all POJO classes for

avatar
m*o
3
It is because the DB2 database is going to be out of the picture permanently
, but the java program will stay and the only way for the java program to
get the needed data is this MySQL database. But, the two databases have
totally different schemas, not only every single table and every column has
different names, but also the number of tables and columns are different too
. (Don't ask me why because that's a long story and irrelevant to what I
have to achieve)
Thanks for the reply. I'm thinking of hibernate's pojo generator too.

【在 r*****s 的大作中提到】
: didn't understand what you want: why is it about db migration?
: for creating pojos i've used hiternate tools integrated with
: eclipse, it's free.
: there might be other non-free tools for reverse engineer
: db schemas.
:
: sounds
: using
: for

avatar
r*s
4
then if your mysql dba wouldn't conform to db2's schema,
java devs have to develop some kind of mapping -- still
very bad -- maybe mapping first, and then based on unit-
tests, you will start to replace java entities one by one,
without affecting the impl above.

permanently
has
too

【在 m******o 的大作中提到】
: It is because the DB2 database is going to be out of the picture permanently
: , but the java program will stay and the only way for the java program to
: get the needed data is this MySQL database. But, the two databases have
: totally different schemas, not only every single table and every column has
: different names, but also the number of tables and columns are different too
: . (Don't ask me why because that's a long story and irrelevant to what I
: have to achieve)
: Thanks for the reply. I'm thinking of hibernate's pojo generator too.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。