![]() These files contain database connection specifics, connection pooling details, and transaction factory settings, as well as references to other XML files that describe tables in the database. XML files containing configuration data provide Hibernate with details about databases with which it needs to interact. Hibernate also has the ability to generate Java source files to match the structure of a database, as will be discussed in more detail in the next section. Declarative entity relationship management. ![]() Programmatic as well as declarative queries.Hibernate is an open-source object/relational mapping toolkit that relieves the need to make direct use of the JDBC API. This article will introduce two tools that radically simplify the data access development process, as well as a lightweight framework built on top of these tools to hide their implementation details from a client application that wishes to leverage the benefits these tools provide. Instead, a solution could create a natural mapping between Java objects and database entities, one that would require a minimum of hand coding to maintain that mapping without removing any of the data retrieval and control facilities provided in the JDBC APIs. Preferably, the alternative should not rely on JDBC Statements, SQL strings, or ResultSets. This is problematic, if not inelegant.Ī better way to interact with a datastore is to eliminate explicit hand-written references to datastore entities while also providing a simple and intuitive API to retrieve and update data that is backed by a database. While effective, this approach is fragile because it relies on Strings in application code matching the names of database tables and columns changing the names of database tables or columns required finding all of their references in the code and changing them. The lookup calls returned ResultSets that an application would use by calling accessor methods matching the data types of the returned columns. There are a variety of open source tools available today for constructing a data access API that simplify what has been in the past been a complicated and error-prone mechanism.īefore these tools became available, applications resorted to calling JDBC APIs and passing SQL strings to Statement objects to execute data lookup queries. A Simple Data Access Layer using HibernateĪ Simple Data-Access Layer using Hibernate.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |