Although pureQuery methods can
deal with input parameters
and return values defined as unstructured types (primitive wrapper
objects such as Integer and Float objects, Map objects),
you can map relational data to Java objects
best by using beans.
These beans can represent
several different types of data:
- Records in database
tables, views, aliases, and materialized query
tables
- Query results that are returned by SQL queries, including
joins
of several tables
- Query results that are returned by stored
procedures
pureQuery analyzes the public fields and methods
in a bean to determine
its properties. Then, pureQuery uses the names of those properties,
along with the values supplied in the annotations on those properties,
to determine how to map the properties of the bean to the columns
in the database.