MetaModel offers a common domain model for the "datastore" domain. For example, the library provides domain objects such as Table, Column, Query, and DataSet that can be used to query the datasource or even build or alter the structure of the datastore. This model allows you to create and manipulate SQL queries via JDBC against relational databases. It also provides the same query capabilities against CSV and Excel files.
MetaModel's query engine is entirely object oriented. This allows the specification of queries using Java objects instead of arbitrary or potentially error-prone literals. It also provides a level of type-safety in creating the queries.
In discussing the usefulness of the MetaModel library, Sørensen said
[I]t enforces a better way of interacting with your data, based on accepted standards and type-safe query-writing. The framework is small and simple, yet powerful, making it easy to use and easy to learn.The project site claimed that the overall goal for MetaModel is to provide a Java API that allows:
- Traversing and building the structure of datastores.
- Executing datastore-neutral queries in a SQL-like manner.
- Provide datastores that do not support queries with a query engine.
- Implement this system for JDBC databases, CSV files and Excel spreadsheets.
- Split single queries into multiple ones that yield the same collective result, enabling powerful performance optimization and grid execution for heavy work loads.
MetaModel is not equivalent or a replacement for an O/R mapping tool. It may provide a simpler way to implement database interactions than using straight JDBC.