Renaming tables and attributes
So far we assumed that we map classes to database tables having
identical names: A Java™ class User
is being mapped to a relational table with identical name
User
. Sometimes a renaming is desired. We may for example
want to access a legacy database by a newly implemented Java™ application. Choosing meaningful names may
conflict with decisions being taken when the original database design
took place.
In the following example we change the database tables name from
its default User to Person ❶. The
properties uidNummbe
r and cname
are changed
to attribute names numericUid
❷and fullName
❸ respectively:
Java |
|
Sql |
|