Introduction to Entity Beans 121 This mapping of
Introduction to Entity Beans 121 This mapping of objects to relational databases is a technology called object- relational mapping. It is the act of converting and unconverting in-memory objects to relational data. An object-relational (O/R) mapper may map your objects to any kind of relational database schema. For example, a simple object-relational mapping engine might map a Java class to a SQL table definition. An instance of that class would map to a row in that table, while fields in that instance would map to individual cells in that row. This is shown in Figure 6.2. You ll see more advanced cases of mapping data with relationships to other data in Chapter 11. Object-relational mapping is a much more sophisticated mechanism of persisting objects than the simple object serialization offered by the Java language. By decomposing your Java objects as relational data, you can issue arbitrary queries for information. For example, you can search through all the database records that have an account balance entry greater than $1,000 and load only the objects that fulfill this query. More advanced queries are also possible. You can also visually inspect the database data because it is not stored as bit-blobs, which is great for debugging or auditing. Ray Combs accountID ownerName balance 1 1000 Bob Barker2 1500 Monty Haul3 2750 Account Class String accountID String ownerName double balance Account Instance accountID = 1 ownerName = Ray Combs balance = 1000 Account Table Relational Database Figure 6.2 An example of object-relational mapping.
We specialize in RedHat Linux Apache web server technology for site owners and site developers and all our hosting packages come with a wide range of features as standard including automatic backups, visitor statistics, spam filtering, email anti virus and much more. Web Hosting Apache.Try us out!