V
voigt
Hello!
We are currently trying to build a new Java application on top of an
already existing database which cannot be modified, because an old
Delphi application is working with it. The database contains two major
design problems:
1. Some table and field names are lowercase. So we must use quotes in
queries, like "SELECT * FROM "lowercase_table" where "lowercase_field"
= XYZ"
2. Relations are implicit; this means we have quite many relations
between the tables, but these are not defined as FOREIGN KEY. So the
application must "know" what the relations are, it is not possible to
extract this info from the database schema itself.
3. Because of (2) the referential integrity cannot be violated. As you
might guess this results in quite many orphan entries, e.g. User A was
in Group B,
group B was deleted but the reference to group B is still there in
table User.
OK, that's it. At least these are the problems that I am aware of,
possibly there are more.
Now we want to build a new Java persistence layer, using Hibernate
and/or Enterprise Java Beans to make a new Web application that should
work with the same data as the Delphi application.
After some days playing around with Hibernate ddl2hbm and Middlegen I'm
now totally frustrated, because it seems that both tools cannot deal
with (1) and (2). Also it seems that no one else has ever faced the
same problems before, which makes me a little curious...
I really really hope that someone in this group can help, sorry if this
is the wrong group for the topic, please don't flame
Thank you very much in advance for any hints...
Bastian
We are currently trying to build a new Java application on top of an
already existing database which cannot be modified, because an old
Delphi application is working with it. The database contains two major
design problems:
1. Some table and field names are lowercase. So we must use quotes in
queries, like "SELECT * FROM "lowercase_table" where "lowercase_field"
= XYZ"
2. Relations are implicit; this means we have quite many relations
between the tables, but these are not defined as FOREIGN KEY. So the
application must "know" what the relations are, it is not possible to
extract this info from the database schema itself.
3. Because of (2) the referential integrity cannot be violated. As you
might guess this results in quite many orphan entries, e.g. User A was
in Group B,
group B was deleted but the reference to group B is still there in
table User.
OK, that's it. At least these are the problems that I am aware of,
possibly there are more.
Now we want to build a new Java persistence layer, using Hibernate
and/or Enterprise Java Beans to make a new Web application that should
work with the same data as the Delphi application.
After some days playing around with Hibernate ddl2hbm and Middlegen I'm
now totally frustrated, because it seems that both tools cannot deal
with (1) and (2). Also it seems that no one else has ever faced the
same problems before, which makes me a little curious...
I really really hope that someone in this group can help, sorry if this
is the wrong group for the topic, please don't flame
Thank you very much in advance for any hints...
Bastian