-->
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: Unsupported cascade style: create
PostPosted: Thu May 12, 2005 9:25 am 
Senior
Senior

Joined: Tue May 10, 2005 9:00 am
Posts: 125
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.0.2

Full stack trace of any exception that occurs:
Code:
org.hibernate.MappingException: Unsupported cascade style: create
   at org.hibernate.engine.Cascades.getCascadeStyle(Cascades.java:961)
   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:401)
   at org.hibernate.persister.entity.SingleTableEntityPersister.<init>(SingleTableEntityPersister.java:104)
   at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:55)
   at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:206)
   at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1055)
   at be.rmi.intranet.db.HibernateConnectionFactory.<init>(HibernateConnectionFactory.java:68)
   at be.rmi.intranet.db.HibernateConnectionFactory.getInstance(HibernateConnectionFactory.java:116)
   at be.rmi.intranet.VacancyManagerTest.testGetCurrentManager(VacancyManagerTest.java:35)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:324)
   at junit.framework.TestCase.runTest(TestCase.java:154)
   at junit.framework.TestCase.runBare(TestCase.java:127)
   at junit.framework.TestResult$1.protect(TestResult.java:106)
   at junit.framework.TestResult.runProtected(TestResult.java:124)
   at junit.framework.TestResult.run(TestResult.java:109)
   at junit.framework.TestCase.run(TestCase.java:118)
   at junit.framework.TestSuite.runTest(TestSuite.java:208)
   at junit.framework.TestSuite.run(TestSuite.java:203)
   at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:325)
   at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:536)

Name and version of the database you are using:Oracle 8

The generated SQL (show_sql=true):


According to Hibernate 3.02 doc chapter 10.11 'Transitive Persistence' it is possible to casacade the creation operation on associations. I did add a cascade="create,save-update" on all associations i used to achieve this. however, Hibernates throws a Exception telling the 'create' cascade is not supported. any idea why?

Mapping used:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="be.rmi.intranet.db.users" default-lazy="true">
<class name="be.rmi.intranet.db.users.FunctionBackup" table="USER_FCT_BACKUP" lazy="true">
  <id name="id">
   <column name="backup_id" not-null="true" unique="true" sql-type="NUMBER"/>
      <generator class="sequence">
       <param name="sequence">user_function_backup_seq</param>
      </generator>
  </id>
   <property name="priority" column="PRIORITY" not-null="false"/>
   <many-to-one name="function" column="fct_id" not-null="true" cascade="create,save-update"/>
   <many-to-one name="user" column="empl_id" not-null="true"/>
</class>
</hibernate-mapping>


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 12, 2005 9:50 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
change create to persist, the doc should be updated soon.

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


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.