Hibernate version:
3.2.2 I think. Downloaded about a month ago.
Name and version of the database you are using:
HSQLDB 1.8
Hi,
I am totally new to Hibernate, so apologies if I'm missing something elementary here. I have generated some mapping files for my objects, but I have one particular definition which is failing to generate a database table. The only thing that is special about this mapping is that it only consists of a set of dates. When I remove the date mappings and replace them with some plain text properties everything works fine (except that the table isn't of the structure that I want!). The content of the mapping file looks like this:
<hibernate-mapping>
<class name="model.Entry" table="calendar_entries">
<id name="id" column="entry_id">
<generator class="native" />
</id>
<property name="someValue" />
<property name="date" type="timestamp" />
<property name="start" type="timestamp" />
<property name="end" type="timestamp" />
</class>
</hibernate-mapping>
So when I initialise the database this creates an empty table (i.e., it has no columns). If I comment out the properties date, start and end it gives me a two column table containing the id and someValue. If I comment out the someValue property it does not create the table at all.
Things that I have observed or double checked: my Entry class is a proper bean, with getters and setters for everything; no exceptions are generated during initialisation; the log of the SQL contains a "drop calendar_entries if exists" line but no create SQL is generated (or at least logged) during initialisation; the Entry.hbm.xml file is referenced in the same way as other working mappings from hibernate.cfg.xml.
I'm thoroughly baffled - can anyone tell me what's going on?
Thanks in advance for any help,
Cheers
Richard
|