Mr. Persister - Change History
Last update: Nov. 6th 2006
This list shows what features and / or bug fixes the various versions contain.
||Beta for Release
This version is the beta release before the stable release 4.0.0
||Two minor bug fixes
Two minor bugs have been fixed. One was a ResultSet that was not closed in
the DbNameDeterminer. The other was a column type that was not set on setter
mappings, causing boolean-to-int mappings to malfunction for Oracle users.
||Annotation Based Mapping
Annotation based mapping is now possible as an alternative to the more flexible
custom object mapping via ICustomObjectMapper instances. Annotation based mapping
makes it easier to make simple modifications to the default mapping of a class.
You can only create a single mapping for a class via annotation based mapping.
If you need more than one mapping, you will have to revert to using ObjectMappingKey
instances and ICustomObjectMapper implementations.
||ObjectMappingKey factory methods
A few extra factory methods for creating ObjectMappingKey's were added, to make
it easier to signal both that the PK's database generated, and use a custom
table name for the mapping.
||"isSomeProperty" naming convention recognized as getter
By accident the "isSomeProperty" naming convention was not recognized
as a getter, and thus could not be mapped to the database. Now it can.
||Boolean to number mapping for Oracle users
Oracle doesn't have a boolean type. Thus
boolean values are typically stored in a numeric(1) or a char(1).
Therefore booleans can now be mapped to numeric column types. 0 = false, 1=true.
In addition the design is updated internally to enable mapping to non-default
column types (String to a numeric column, Date to a numeric or character column etc.)
in the future,
but only the boolean numeric mapping is fully implemented. If you need others, let us know.
||Convenience methods in PersistenceManager and new functions in JDBC DAO
Four convenience methods on the PersistenceManager now makes it a bit easier/shorter
to execute dao commands. The JDBC DAO now has a readIdString method that can read
a ResultSet of id's into a (id1, id2, ...) string that can be appended to another
SQL query's "...where id in " clause.
The JavaDoc has been updated for all new features too.
||New JDBC DAO and Map Dao
Mr. Persister now has a JDBC DAO and a Map DAO too. The JDBC DAO
makes it easier for users to do ordinary custom JDBC without having
to worry about all the details. The Map DAO makes it easy to
read records into Map's or List's of Map's. This can be
handy for dynamic reporting purposes. You can even mix
the use of the various DAO's. For instance, use the Map DAO
or Generic DAO from inside a JDBC DAO call.
||Bug Fix: Determining Oracle DB failed
A small bug caused Mr. Persister not to be able to
determine the database when running against Oracle.
That bug has now been fixed.
Thanks to Cladio Crociati for reporting the bug.
||Stable release of 3.2.10
Version 3.4.0 contains support for the Daffodil / One$DB Java database,
H2 Java database and Derby Java database, as implemented in version 3.2.3,
3.2.4 and 3.2.10. 3.4.0 also contains minor performance enhancements, and
better adaptation to the database used, as implemented in earlier versions,
and in 3.2.9 and 3.2.10.
||Daffodil / One$DB Support and Increased Performance
Version 3.2.10 contains support for the Daffodil / One$DB Java database.
It also contains sligtly better performance on inserts of objects
that do not have auto generated keys.
This version contains slightly better performance for updates and deletes.
||Derby Database Compliance
From version 3.2.4 Mr. Persister is tested to work with the Derby database.
||H2 Database Compliance
From version 3.2.3 Mr. Persister is tested to work with the H2 database.
||Connection and Transaction Scoping
Connection and transaction scoping makes it easy to mark for instance a
group of Java-statements, a method, or all methods of an object, to
execute using the same connection, and/or within the same transaction.
Connection and transaction scoping takes care of opening the connection,
committing / rolling back the transaction and closing the connection correctly
again. It's a bit like the dao commands, only more flexible. Connection
and Transaction scoping works with any JDBC code, even if you do not
use Mr. Persisters DAO classes. As long as you use a DataSource, you
can apply the connection and transaction scoping to your project.
||Bug Fix of Insert/Update SQL generation for mappings with autogenerated columns.
If an auto-generated column appeared last in the object mappings
list of columns, the generated SQL had a dangling comma, resulting in invalid SQL. Problem
||Minor updates to IDaoCommand, IDaoCommandExecutor and IDaoCommandExecutorUnchecked interfaces.
An IDaoCommand can now return an object from the execute() method. This is handy when doing anonymous
IDaoCommand interface implementations.
||Automatic connection and transaction management.
Mr. Persister can open and close connections for you automatically,
and commit/rollback transactions too. This is achieved via DAO commands.
Mr. Persister is now tested to work with the Firebird open source database.
||Adjustment to automatic setter mapping of overloaded setters.
If a class contains overloaded setters, the setter that has the same
parameter type as the matching getter's return type will be mapped to the database.
Not all of the overloaded setters will be mapped to the database.
If no getter matches any of the overloaded setters the first setter
that is found that has a parameter type Mr. Persister can map, will be used.
||Bug fixes - additions
Further corrections related to the bug fixes in 3.0.11 and 3.0.12.
||Bug fix - Number types write to database gave NullPointerException.
If a getter method returned null the API still tried to insert the value in the
PreparedStatement. Now it only inserts the value if it is non-null.
||Bug fix - Number types read from database with null column values.
Before this version number types (int, long etc.) and their coresponding
objects (Integer, Long) read from the database were read as 0 if the value in the
database was NULL. Now the setter method will not be called if the column value in the
database is NULL.
||MySQL import fix.
To avoid a problem with a missing feature in the MySQL driver a hidden reference
to a fully qualified MySQL class has sneaked into the code. It has now been replaced
with a reflection call, so there is no longer any dependency on the MySQL driver
||PersistenceManager class replaces static factory method in MrPersister class
Instead of getting to the factories directly through the MrPersister class, now first create
a PersistenceManager instance, assign it to a constant in you rapplication (make it a singleton),
and get the factories from there. The rest is the same. The
PersistenceManager avoids problems with the MrPersister class being loaded once by an application
server, and shared among all web applications. In that case all default persistence
configurations would be shared too. Not entirely desirable.
||ICustomObjectMapper in ObjectMappingKey instances
MrPersister.getObjectMappingFactory() instance to create object mapping keys
that can contain
ICustomObjectMapper instances. The custom object mapper instance
is used to create custom object mappings, or modify auto-generated mappings.
||Automatic Mapping Optimized
Automatic mapping is now many times faster than before (10-100 times faster,
sometimes even up to 1000 times). The more getters / setters, the larger the gain.
IPersistence used by the
||Transaction convenience methods on IGenericDao
The IGenericDao interface now has a
commit(), and a
rollback() method, so you don't
have to get to the underlying connection to do that. The methods forward the
calls to the same methods on the underlying Connection.
||Support for Compound Primary Keys (multi column keys)
From this version Mr. Persister is capable of using and auto-detecting
compound primary keys.
||GenericDao as alternative to subclassing AbstractDao
You will be able to instantiate a GenericDao and pass it a connection
in the constructor / factory method.
This connection will be used for all GenericDao method calls.
The methods in the GenericDao will be the same
as in the AbstractDao, only public. You will be able to start
a transaction and have GenericDao method calls execute transparently within
||Bug Fix: Missing W in WordTokenizer string, now inserted
A W was missing in the tokenizer string used to split a class name
into words. Hence users may have experienced incorrect auto-mapping
of classes to tables if you have used class names or table
names with a capital W in.
||Getters must return a value
Until now a method starting with "get" or "is" was considered
a getter. From now on it is also a requirement that the
method returns a value. It is now also a requirement that
getter methods takes no parameters. So
public void getOutOfBed()
public int getToAction(int actionType)
will not be considered getter methods.
||Update convenience methods in AbstractDao
Until now insert, update and delete methods in the AbstractDao
requires an object mapping key
to be provided. These new convenience methods do not take this object
mapping key as a parameter. They assume that the object mapping key of the
object to be written is the object.getClass() class object.
||Bug fix of ObjectMappingKey
For some reason the factory method had not been made static. Now it is.
In addition it has been made easier to use.
||Minor bug fix with MySQL 4.1.0 alpha
Apparently MySQL 4.1.0 alpha insists on having a space in insert statements
between the table name and the brackets with the column names, and also
after the "values" keywords and the following brackets:
insert into table (a,b,c) values (?,?,?)
Whether this is a bug in Mr. Persister
or MySQL 4.1.0 alpha I don't know, but now it's fixed.
Thanks for the notification, Tom!
||Better support for manual / mixed mapping
Overriding one or two of the methods inherited from AbtractDao
increases control of the mapping. Provide the table name,
create mappings automatically and manipulate them before use,
or create mappings completely manually.
||Better Support for transactions
All methods inherited from AbstractDao can now take a JDBC component
(connection, result set, statement or prepared statement) and perform
i'ts operation via that.
||Support for batch updates
Pass a list of objects to the AbstractDao's list write methods,
and Mr. Persister will insert, update, or delete the objects
in a single database call using a batch update.
||Automatic SQL generation for, and execution of, the trivial JDBC tasks
- read list of objects by their primary keys, in a single SQL statement
- insert list of objects using batch updates
- update list of objects using batch updates
- delete list of objects using batch updates
- delete list of objects by their primary keys using batch updates
||Minor bug fix
Fixes problems with HSQLDB and Microsoft SQL Server.
||SQL as query language
If you database understands your SQL, so does Mr. Persister.
||Map objects to SQL queries
This feature makes it possible to map objects to arbitrary SQL queries
like complex joins, or aggregate functions like
select sum(...) from ... where ...
||Automatic mapping of objects to tables
Mr. Persister's ObjectMapper is capable of guessing most trivial mappings of
classes to tables. By trivial is meant where the class and table, + the
getters / setters and the columns have similar names.
See getting started guide or technical overview for more details.
||Caching of object mappings
Object mappings are cached and reused. You can insert custom object mappings
into the cache too.
||Support for transactions.
AbstractDao's methods can execute in transactions
||Caching of generated SQL
All auto-generated SQL is cached and reused.
||Automatic SQL generation for, and execution of, the trivial JDBC tasks
- read object by primary key
- insert object
- update object
- delete object
- delete object by primary key
||< 5% overhead on the readByPrimaryKey method with MySQL