Using beans with pureQuery Runtime

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:

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.

pureQuery annotation can also be specified in a set of nested beans to return data from SQL queries that contain table joins. The hierarchy of the beans represents the relationships of the data returned. For example, a query contains a join between a department table and an employee table. The query returns the employees in each department. The nested beans are populated with a Department beans containing a List of Employee beans.


Feedback