Share

DbUnit

Tracker: Bugs

5 Improvements on HxxxxDataFactory - ID: 1897620
Last Update: Comment added ( gommma )

Both H2DataTypeFactory and HsqldbDataTypeFactory are identical (which makes
sense, as the DB are related), and hence should derive from a common
superclass.
Also, there is something wrong with either the test case or the
implementation, as the tests pass even if the custom code to handle the
BINARY type is removed from the factory.
Finally, it would be nice to have a real rest case, that uses an embedded
database to test such factories.


Felipe Leme ( felipeal ) - 2008-02-20 09:00

5

Closed

Wont Fix

Roberto Lo Giacco

None

None

Public


Comments ( 5 )

Date: 2008-11-22 16:41
Sender: gommma

I removed the TODOs from the code (svn rev. 883). Thanks for your goodwill
:-)


Date: 2008-11-21 19:13
Sender: felipealProject Admin

Yes, I saw that too.

Anyway, I think both approaches have their advantages and disadvantages.
If you prefer to keep as is, I'm fine with that, but please remove the TODO
from the Javadocs before closing this ticket.



Date: 2008-11-21 19:01
Sender: gommma

Aha. Thanks for this detailed information. I see your point. But this one
sentence

"however H2 does not share any code with Hypersonic SQL or HSQLDB"

is the key fact to me for keeping those 2 dbunit factories completely
separated.

Another indicator making me afraid of creating this superclass is that we
would need to describe this fact in detail in the javadocs (as you already
suggested).


Date: 2008-11-21 18:19
Sender: felipealProject Admin

Hi Mat,

Technically speaking, they are not related, as pointed out in
(http://www.h2database.com/html/history.html):

"The development of H2 was started in May 2004, but it was first published
on December 14th 2005. The author of H2, Thomas Mueller, is also the
original developer of Hypersonic SQL. In 2001, he joined PointBase Inc.
where he created PointBase Micro. At that point, he had to discontinue
Hypersonic SQL, but then the HSQLDB Group was formed to continued to work
on the Hypersonic SQL codebase. The name H2 stands for Hypersonic 2;
however H2 does not share any code with Hypersonic SQL or HSQLDB. H2 is
built from scratch."

Pragmatically speaking, though, I think they are very similar,
particularly from the point of view of client code (I used both within
Hibernate test cases, and they behave exactly the same).

So, my suggestion is that we have an abstract super-class (some thing like
HxxxDataTypeFactory) with the common code (and explain in the Javadoc that
they are similar, but not exactly related), then extend it to the existing
H2 and Hsqldb types.

-- Felipe




Date: 2008-11-21 09:06
Sender: gommma

Hi Felipe,

are the H2 and HSQLDB implementations related to each other? AFAIK they
are not and it probably is by chance that the DataTypeFactories are equal.
This is why I would not create a common superclass for those two. What do
you think?

Regards,
mat


Attached File

No Files Currently Attached

Changes ( 3 )

Field Old Value Date By
status_id Open 2008-11-22 16:41 gommma
resolution_id None 2008-11-22 16:41 gommma
close_date - 2008-11-22 16:41 gommma