users
[Top] [All Lists]

Re: [cinjug-users] hibernate problem

To: users@xxxxxxxxxx
Subject: Re: [cinjug-users] hibernate problem
From: Brian K Bonner <brian.bonner@xxxxxxxxxxxx>
Date: Thu, 16 Sep 2004 17:04:55 -0400
Delivered-to: mailing list users@cinjug.org
In-reply-to: <4149F4EF.1050702@ic-institute.com>
Mailing-list: contact users-help@cinjug.org; run by ezmlm
Hey Trey,

Verify that you are setting the timeline on the Launcher prior to the 
save?  Is the launcher added to the timeline set?

1.  provide a snippet of the test case that exhibits this behavior 
(between your opensession and closesession) 
2.  enable debug in log4j to see if that helps identify the problem.

Post both 1 and 2 to provide us additional clues.

Did you check forum.hibernate.org?

Brian


Trey Howard <trey.howard@xxxxxxxxxxxxxxxx> wrote on 09/16/2004 04:17:51 
PM:

> Hi All
> 
> I'm having a problem with getting a hibernate mapping to work.
> 
> I have a parent, class Timeline, that has children, class Launcher.
> 
> Here is the xdoclet hibernate mapping in Timeline for the Launcher set
> @hibernate.set table="timeline_launcher" cascade="none"
> @hibernate.collection-key column="parent_timeline"
> @hibernate.collection-one-to-many class="fqns.Launcher"
> 
> Here is the xdoclet hibernate mapping in Launcher for the parent 
Timeline
> @hibernate.collection-key column="parent_timeline"
> @hibernate.collection-many-to-one class="fqns.Timeline"
> 
> 
> The problem is that when I retrieve a child Launcher instance, the field 

> for the parent Timeline shows null, whereas the database shows the 
> correct value.
> For instance:
> I have a Timeline id=1 and create a new Launcher and .saveOrUpdate() it 
> to give it an id of 4.
> The Launcher (POJO) will return that its parent Timeline is 1 (this is 
> what's in the database, also).
> However, if I then perform a .load(4), the Launcher (POJO) will return a 

> null parent Timeline.
> 
> So, it appears as though I can save the parent-child relationship, but I 

> can't retrieve it.
> Do I need to specify an option to one of the above mappings to achieve 
> the functionality I described?
> 
> In case it matters, I'm running MySQL 3.23.58
> 
> Any help would be appreciated!
> -Trey
> 
> 
> ---------
> You may unsubscribe from this mailing list
> by sending a blank email addressed to:
> users-unsubscribe@xxxxxxxxxx
> 
> --
> Find additional help by sending a blank email
> addressed to:
> users-help@xxxxxxxxxx
> 


<Prev in Thread] Current Thread [Next in Thread>