Basically the idea is to use the same hibernate mapping files for two different underlying databases. In production the underlying database is MySQL5 and for testing purposes I'd like to use Apache Derby - in order to avoid setting up and maintaining various MySQL databases for testing purposes.
I hoped that just switching the DataSource's Driver and changing a few params would do the job, but I've already run into some minor difficulties. So there are in fact two questions. The first concrete question is:
I. Is it possible to tell Derby which datatype to use if a datatype is available in MySQL and is not in Derby. The mapping is as follows:
<property name="about">
<column name="`about`" not-null="false" sql-type="text"></column>
</property>
Derby doesn't know the sql-type "text" so it refuses to create the table. It is Derby 10.4.2.0 and Hibernate 3.2.6. by the way.
II. What's your experience with using two different databases for testing and in production? I know there are some drawbacks that e.g. you can't test stored procedures or database specific queries - but on the other hand it makes testing easier and faster (if you finally got it running). What do you think?