New features

Execute UPDATE and DELETE operations

With MetaModel 3.0 we now offer a full set of CRUD operations on your datastores! This means that in addition to querying and inserting records, you can now also update records and delete them.

The UPDATE and DELETE operations can be fired on all UpdateableDataContext implementations, which currently include:

  • JDBC databases
  • CSV files
  • Excel spreadsheets
  • MongoDB databases
  • CouchDB databases

Execute CREATE TABLE and DROP TABLE operations

In MetaModel 3.0 you're also now able to create and drop tables at runtime. For instance, you can use it to create temporary, but persistent tables, or dynamically fit your data model at runtime. Doing so is done using the executeUpdate(...) method on any of the UpdateableDataContext implementations, which currently include:

  • JDBC databases
  • CSV files
  • Excel spreadsheets
  • MongoDB databases
  • CouchDB databases

The notion of a 'table' differs a bit in these datastores, so take a look at the Schema and table semantics page for a full overview.


CouchDB support

We have a brand new module in MetaModel 3.0 which offers CouchDB support! Now you can query and update your CouchDB database just like you would query any regular database.


A Java object based datastore

Another new module in MetaModel 3.0: Java object support (aka. the POJO module). While this might not seem so impressive at first, it is actually quite useful. You can use for instance for unittesting purposes or to allow users to test-drive your data flows using simple in-memory data.


Primary key awareness

MetaModel is now aware of primary keys. Obviously this is extremely important when dealing with UPDATE and DELETE operations. Therefore you will find two new methods: Table.getPrimaryKeys() and Column.isPrimaryKey().

Changes to the existing API

New column types: List and Map

With the widening of the support for NoSQL datastores like MongoDB and CouchDB, we've seen a need for new column types. We've introduced LIST and MAP for this purpose. They map to java.util.List and java.util.Map and allow for these datastore types to represent the full documents contained within them.


Semantics of "row number" changed from 0-based to 1-based.

An important API change for MetaModel in order to improve consistency with other similar libraries: We've changed the row number concept from a 0-based index concept to being a 1-based row number concept! This was done in order to comply with typical usage of row numbers in eg. SQL LIMIT clauses, Spreadsheet applications, the JPA specification and more.

On the down-side, this means that the semantics have changed for a number of methods or classes:

  • The Query.setFirstRow(Integer) and Query.getFirstRow() methods.
  • The CsvConfiguration constructor parameter 'columnNameLineNumber'. Note that the constants NO_COLUMN_NAME_LINE and DEFAULT_COLUMN_NAME_LINE have been adjusted, so when using these constants, no change is needed.
  • The FixedWidthConfiguration constructor parameter 'columnNameLineNumber'. Note that the constants NO_COLUMN_NAME_LINE and DEFAULT_COLUMN_NAME_LINE have been adjusted, so when using these constants, no change is needed.
  • The ExcelConfiguration constructor parameter 'columnNameLineNumber'. Note that the constants NO_COLUMN_NAME_LINE and DEFAULT_COLUMN_NAME_LINE have been adjusted, so when using these constants, no change is needed.
  • The FirstRowDataSet constructor parameter 'firstRow' (rarely used).

We encourage you to check your usage of these methods or classes before upgrading to MetaModel 3.0. Make sure you switch from a 0-based to a 1-based approach when using them.


Operator 'Higher/lower than' renamed to 'Greater/less than'.

The operator types HIGHER_THAN and LOWER_THAN have been deprecated. Use the new GREATER_THAN and LESS_THAN instead.


Allowed referencing a column in a specific aliased table

We've made it possible to construct a SelectItem with a reference to a specific FromItem which means that in case you are referencing the same table multiple times in a query, you can then pinpoint which one a specific select item references.


Logging level moderations

The logging level (especially for the JDBC module) has been moderated to not include as much information in the INFO level as before. This means that you will no longer get eg. the full SQL query in the INFO level, which is an improvement for the security of INFO-logged applications.


Deprecation of DataSet.toTableModel()

The method DataSet.toTableModel() has been deprecated, and we plan on removing it entirely from version 3.1. This is to prevent any hick-ups in environments where the javax.swing package is prohibited (eg. in some OSGi environments) or even not existing (eg. in future Java 8 Jigsaw-based deployments). Users of the method are encouraged to use the class DataSetTableModel instead, which yields the same result.

Bugfixes

Fixed index-issue in handling of boolean JDBC values

An issue with retreiving JDBC boolean values was discovered and fixed.