摘要 |
In Java or another programming language, software components load data from a database and store data in the database. When a software component is initialized, that component's fields are queried to map those fields to fields in the database and to form a persistable field graph of the mapping. During that phase, commonly used SQL statements are generated. Operations between the software component and the database are handled by traversing the persistable field graph. Classes referenced by the software component can be similarly mapped; in that case, each field in the class is mapped to a field in the database. The needed SQL statements can be generated by an abstract database persistence class which translates database calls into the specific version of SQL supported by the database, so as to provide transparent support for different types of databases. |