-->
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.  [ 2 posts ] 
Author Message
 Post subject: Usupported cascade style: create
PostPosted: Wed May 11, 2005 9:11 am 
Regular
Regular

Joined: Fri Feb 13, 2004 10:02 pm
Posts: 90
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


Top
 Profile  
 
 Post subject: Re: Usupported cascade style: create
PostPosted: Wed May 11, 2005 9:17 am 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
Before posting, you should perform a search on the forums... this question has been asked and answered more than a couple of times...

http://forum.hibernate.org/viewtopic.ph ... cade+style
http://forum.hibernate.org/viewtopic.ph ... cade+style


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

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.