Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
Hibernate version:
3.03
Mapping documents:
Document.hbm.xml
Code:
<hibernate-mapping package="com.llic.business">
<class name="Document" table="Document" polymorphism="implicit">
<meta attribute="implement-equals">true</meta>
<meta attribute="generated-class">com.llic.business.base.DocumentBase</meta>
<id name="id" column="documentid" type="java.lang.Long">
<meta attribute="use-in-equals">true</meta>
<generator class="native" />
</id>
<property name="contentMgrUniqueKey" column="contentMgrUniqueKey" length="16" type="string" not-null="true" unique="true" />
<many-to-one name="policyNumber" class="PolicyNumber" column="policyNumberId" cascade="all, delete-orphan"/>
<property name="dateReceived" column="DATERECEIVED" type="java.util.Date" not-null="true" />
<!-- since users are static and we don't want to cascade them on a save or update, we use
the default cascade="none" style -->
<many-to-one name="nbaUser" class="User" column="nbaUserId" />
<many-to-one name="uwUser" class="User" column="uwUserId"/>
<many-to-one name="documentSubType" class="com.llic.domain.DocumentSubType" column="documentSubTypeId"/>
<many-to-one name="parentApplication" class="Application" column="parentAppDocId" cascade="create, merge, save-update"/>
<!-- we don't want the setter public so we can control the constant values -->
<property name="nbaNotificationStatus" column="nbaNotificationStatus" type="java.lang.Character" not-null="false">
<meta attribute="scope-set">protected</meta>
</property>
<!-- we don't want the setter public so we can control the constant values -->
<property name="uwNotificationStatus" column="uwNotificationStatus" type="java.lang.Character" not-null="false">
<meta attribute="scope-set">protected</meta>
</property>
<property name="scanPacketNumber" column="packetnumber" length="22" type="string" />
<property name="nbaNotificationDate" column="nbaNotificationDate" type="java.util.Date" />
<property name="uwNotificationDate" column="uwNotificationDate" type="java.util.Date" />
<property name="grouping" column="grouping" type="java.lang.Long" length="2"/>
</class>
Full stack trace of any exception that occurs:Code:
Caused by: org.hibernate.MappingException: Unsupported cascade style: create
at org.hibernate.engine.Cascades.getCascadeStyle(Cascades.java:996)
at org.hibernate.mapping.Property.getCascadeStyle(Property.java:92)
at org.hibernate.tuple.PropertyFactory.buildStandardProperty(PropertyFactory.java:127)
at org.hibernate.tuple.EntityMetamodel.<init>(EntityMetamodel.java:149)
at org.hibernate.persister.entity.BasicEntityPersister.<init>(BasicEntityPersister.java:400)
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:87)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:210)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.newSessionFactory(LocalSessionFactoryBean.java:587)
at org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet(LocalSessionFactoryBean.java:522)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1073)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:343)
... 20 more
Name and version of the database you are using:
DB2 UDB 8.2
I am receiving this error when I am trying to initialize my SessionFactory. According to the documentation in section 11.11. Transitive persistence,
" For each basic operation of the Hibernate session - including persist(), merge(), saveOrUpdate(), delete(), lock(), refresh(), evict(), replicate() - there is a corresponding cascade style. Respectively, the cascade styles are named create, merge, save-update, delete, lock, refresh, evict, replicate."
Shouldn't "create" be changed to "persist" in the documentation for cascading?
Todd