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: calling Session.Update() on Object loaded from Database
PostPosted: Tue Jul 22, 2008 8:03 am 
Newbie

Joined: Tue Jul 22, 2008 7:46 am
Posts: 1
Location: INDIA
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 3.2

Mapping documents:<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<!-- class mappings -->
<hibernate-mapping schema="DataBaseSchema">

<!-- VIEW -->
<class name="com.view" table="VIEW">
<cache usage="read-write"/>
<id name="id" type="long" column="ID">
<generator class="sequence">
<param name="sequence"VIEW_ID</param>
</generator>
</id>

<property name="name" type="string" column="NAME" />
<property name="ownerId" type="long" column="OWNER_ID" />

<set name="panels" cascade="all-delete-orphan,save-update,persist">
<cache usage="read-write"/>
<key column="VIEW_ID"/>
<one-to-many class="com.panel"/>
</set>

<set name="mappings" cascade="all-delete-orphan,save-update,persist">
<cache usage="read-write"/>
<key column="VIEW_ID"/>
<one-to-many class="com.panelMapping"/>
</set>

<set name="scripts" cascade="all-delete-orphan,save-update,persist">
<cache usage="read-write"/>
<key column="VIEW_ID"/>
<one-to-many class="com.script"/>
</set>
</class>

<!-- PANEL -->
<class name="com.panel" table="PANEL">
<cache usage="read-write"/>
<id name="id" type="long" column="ID">
<generator class="sequence">
<param name="sequence">PANEL_ID</param>
</generator>
</id>
<property name="name" type="string" column="NAME"/>
<property name="width" type="integer" column="WIDTH"/>
<property name="height" type="integer" column="HEIGHT"/>
<!-- Hibernate logic xPos = getXPos = XPos = break -->
<property name="xxPos" type="integer" column="XPOS"/>
<property name="yyPos" type="integer" column="YPOS"/>

<property name="wiped" type="character" column="WIPED" />

<many-to-one
name="script"
column="SCRIPT_ID"
lazy="false"
/>

<many-to-one
name="parent"
column="VIEW_ID"
lazy="false"
/>


</class>

<!-- SCRIPT -->
<class name="com.script" table="SCRIPT">
<cache usage="read-write"/>
<id name="id" type="long" column="ID">
<generator class="sequence">
<param name="sequence">SCRIPT_ID</param>
</generator>
</id>

<many-to-one
name="parent"
column="VIEW_ID"
lazy="false"
/>

<property name="name" type="string" column="NAME"/>
<property name="type" type="string" column="TYPE"/>
<property name="code" type="text" column="CODE"/>

</class>



<!-- PANEL MAPPING -->
<class name="com.panelMapping" table="PANEL_MAPPING">
<cache usage="read-write"/>
<id name="id" type="long" column="ID">
<generator class="sequence">
<param name="sequence">PANEL_MAPPING_ID</param>
</generator>
</id>

<many-to-one
name="parent"
column="VIEW_ID"
lazy="false"
/>

</class>





</hibernate-mapping>

Code between sessionFactory.openSession() and session.close():




Full stack trace of any exception that occurs:

Name and version of the database you are using:
oracle 9i

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html


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.