GenericDAO Release Notes
Version 3.0.2
(Jan 26, 2016)
-
Changed to allow getters without setters. Students wanted to provide extra
getters in their JavaBeans to be called from their JSPs using the EL.
So, in this version, we changed to allow extra getters that do not have matching
setters. However, all setters still must have a matching getter. Hopefully,
this will provide the level of error checking we want, which is to signal the
student that they may have a mis-spelling or a mis-capitalization, but will still
allow enough flexibility that students can access these JavaBeans from their
views without having to create a view bean to provide the extra info.
Version 3.0.1
(Jan 8, 2016)
-
Added code to throw
RollbackException when attempting to write Strings that
are bigger than the max size for the field. Previously, you would get a SQLException
which was confusing. This effects both create() and update().
-
Added code validate that the max size of String fields in the bean is the same as the size
in the database table. Previously, this was unchecked, so changes to the bean would not
effect an existing table.
-
Added code to table validation to tell the user that,
when a table does not match the bean,
the easy fix is the drop the table and then let
GenericDAO regenerate
it. Students were often confused when they were given only the description of the inconsistency
in the exception.
Version 3.0.0
(Jan 6, 2016)
-
The
createAutoIncrement() method is now part of
create().
Many users were not calling createAutoIncrement() when
they should have been. Instead they just called create().
So starting with this release, createAutoIncrement() is gone.
Now you can just call create(). The create() method
will check the primary key to see if it is either int
or long. If so, the auto-increment function will be executed, and the
primary key value will be copied back into the JavaBean provided as the
parameter. (Previously, this was the difference between create() and
createAutoIncrement().)
-
Starting in this version, if
GenericDAO
sees a getter
without a matching setter or a setter without a matching getter,
the constructor will throw DAOException.
Previous versions would ignore getters that did not have matching setters.
This was considered a feature to allow the use of getters and setters that
provided or set computed data that was not explicitly stored in a DB field,
but this seems to have caused confusion when students misspelled or
miscapitalized names. So, now your beans may not contain any methods
starting with "get" or "set" unless they are identifying
properties that are to be stored in the database.
-
The
@MaxSize annotation,
if used, now needs to be set on the setter
of a string property. In previous versions, it was set on the private
instance variable, which students often misnamed or miscapitalized, causing
GenericDAO to throw an DAOException when it could not
find the field.
-
New documentation for
GenericViewDAO
plus other documentation improvements.
Version 2.0.2
(Feb 10, 2013)
-
It appears that some versions of MySQL, in particular 5.5.29, return the AUTO_INCREMENT id as a
BigInteger.
This was causing a ClassCastException to be thrown on calls to createAutoIncrement().
This version has a fix which will notice when BigInteger is returned and convert it into a Long.
Version 2.0.1
(Nov 27, 2012)
-
Fixed bug in
GenericDAOImpl.tableExists() (which is called by the GenericDAO constructor).
The bug caused NullPointerException to be thrown when handling a SQLException thrown by a call
to JDBC's getConnection thereby preventing us from seeing what the SQLException was.
With this fix, the SQLException will now call a DAOException (with the SQLException
as the cause) to be thrown (as it should have been in the first place).
Version 2.0.0
(Mar 29, 2012)
-
First release of new code base that's not written on top of the old BeanFactory code.
-
Added
GenericViewDAO for use with "view" bean. The expected use is that you want to run a join of multiple tables.
You instantiate a GenericViewDAO with a Java Bean that store rows of the result of the join.
Use the executeQuery() method to run the SQL. This method will return the results in instances of the JavaBean.
-
The
ConnectionPool class now has a
getTransactionConnection() method that allows you to write your own SQL
calls and run them in the same transaction used for other GenericDAO calls.
-
Printing of debugging messages (which tells you the SQL being generated and when connections
are being allocated, etc) is now set up via the
ConnectionPool class using setDebugOutput().
This setting can be overridden on any specific transaction using Transaction.setDebugOutput().
-
Removed support for enums. Enums support might be added back, but we don't believe anyone was using it.
Use Strings for now.
-
Removed support for array.
For arrays, you should make a separate bean and another DAO to handle the array data.
Use a composite key for quick access. Hopefully,
the tutorial (not yet written) will have a chapter on how to do this.
Version 1.0.2
(Feb 24, 2012)
-
Fixed
@MaxSize annotation so that it now will be used to set the size of String fields when creating a table.
-
Bug Fix:
java.sql.Date and java.sql.Time were incorrectly being mapped to java.util.Date when
being read in from the database causing IllegalArgumentException to be thrown from read() and match() calls.
Version 1.0.1
(Feb 21, 2012)
-
Added JavaDoc for most classes in
org.genericdao package.
-
Removed extra copy of
MatchOp class that was accidently left in org.genericdao package.
-
Added
org.genericdao.Version class and manifest file to JAR file.
Version 1.0.0
(Feb 14, 2012)
-
This is the initial version built by putting a layer on our previous BeanFactory ORM environment.
Moved all the BeanFactory code to
org.genericdao.impl.