Guys, I am running out of ideas here. Somehow when I invoke the following snippet:
// retrieval of 'user' and 'media' obj from DB
UserMedia userMedia = new UserMedia();
userMedia.setUser(user);
userMedia.setMedia(media);
session.save(userMedia);
This code is giving me the exception
Quote:
Caused by: java.sql.BatchUpdateException: Field 'UUID' doesn't have a default value
It would be nice if someone took a glance at my HBMs as I am completelly running out of ideas here. Thanks!!
USER.HBM.XML
Code:
<hibernate-mapping package="model">
<class name="User" table="USER">
<id name="userId" column="UUID">
<generator class="native" />
</id>
<property name="name" type="text" />
</class>
</hibernate-mapping>
MEDIA.HBM.XML
Code:
<hibernate-mapping package="model">
<class name="Media" table="MEDIA">
<id name="mediaId" column="MEDIAID">
<generator class="native" />
</id>
<property name="name" type="text" />
</class>
</hibernate-mapping>
USERMEDIA.HBM.XML
Code:
<class name="UserMedia" table="USER_MEDIA">
<id name="userMediaId" column="USERMEDIAID">
<generator class="native" />
</id>
<one-to-one name="user" class="model.User" />
<one-to-one name="media" class="model.Media" />
<property name="rate" type="double" />
<property name="rateFormat" type="string" column="RATE_FORMAT" />
</class>