An object oriented method and computer system for implementing a
persistence mechanism. The persistence mechanism is adapted to effectuate
data transfer between a software application and a relational database.
The method identifies homes and relationships. Each identified home
includes attributes of a table of the database. Each identified
relationship has attributes describing a foreign key interaction between
two homes of the identified homes. A provided home class is adapted to be
instantiated to any of the identified homes. A query to transfer data
between the application and the database is generated such that a first
home of the identified homes is processed. The first home includes
attributes of a first table of the database. The processing of the first
home includes an instantiation of the home class to an instance of the
first home by setting attributes of the first home.