Hibernate transport is very similar to JDBC, but instead of handling a list of maps, it deals with POJOs and it lets Hibernate do all the mapping work.
The transport exists in 2 flavors:
- 1.X series, to use with Mule 1.X (including EE versions)
- 2.0 series, to use with Mule 2.0
The endpoint URI looks like this: "hibernate://queryName" where queryName can be anything.
For an inbound endpoint, the endpoint should have a corresponding property which is a valid HQL "select" statement ; whereas for an outbound endpoint, it can either be an "update" statement, or just "merge" (the message payload is then merged) or "delete" (the message payload is then deleted).
For an inbound endpoint, there are more properties that can be set:
- ack: an HQL statement used to acknowledge the message just received.
- singleMessage: a boolean to specify that whether the resultset should be considered as 1 message or multiple
- singleAck: a boolean to specify whether the "ack" statement applies to each element of the resultset or all of them at once
- maxResults: the maximum number of rows to return from the "select" statement
The most interesting properties that can be set on a connector are:
- sessionFactory: the Hibernate SessionFactory object that allows to connect to a data source.
- sessionMerge (and sessionDelete): allows to override the default action for "merge" (resp. "delete"). Useful when you can't know the key of an Object (for instance it's auto-generated), but you can determine it (using other "business" constraints).
The connector has been ported to the new API and spring-based configuration, but nothing else was changed (but XA transaction handling which could be simplified).
With our library of Cloud Connectors and repeatable integration solutions, you can rapidly create connectivity either on premise or in the cloud.