-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: database tables not being created when using Date field
PostPosted: Sat Apr 14, 2007 7:39 am 
Newbie

Joined: Sat Apr 14, 2007 7:23 am
Posts: 6
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.