Well, the free documentation is kind of terse.   I
read slowly, so I like that. :)

I'm working on a simple example with just Hibernate
and JSF as a way to learn JSF (which is involving some
of my own head banging, but that's just me being a JSF
newbie).   I'll probably post my JSF/Hibernate session
management example to my blog at some point.  

RE: the m:n problem, I imagine the design of the
backing beans and DAOs (and transfer objects, in my
case ;) )  would depend on the UI.   When you say m:n,
you mean many-to-many, right?  What would be a good
example UI design for managing a m:n relationship?

--- Werner Punz <[EMAIL PROTECTED]> wrote:

> Ah no need for excuse, I value Hibernate
> as what it is, one of the best orm solutions in
> existence,
> the head banging is mostly a documentation problem.
> 
> 
> Actually, I think the main problem is, that there is
> no real page
> with code templates for standard situations in a
> webcentric manner,
> which would resolve those issues to 90%
> 
> I will give you an example, you have the classical
> m:n situation in a 
> webcentric manner,
> you want to add form data, the classical error you
> run into, is that you 
> have some form data traversed over the session
> boundary, and
> you want to set the m:n relational data to the new
> state...
> 
> Hibernate has some examples on how to deal with m:n
> relations
> (basically dump the relation and set it anew)
> now you have the classical situation you load one
> side of the relation
> you set rootboject.getRelset().clear();
> update(rootboject)
> 
> and you nail the external data in...
> now you get the error, object has been reused in the
> session
> because the old relational objects are still in
> there.
> 
> I tried in hibernate 2 at such as stage a session
> clear()
> that did not work, with no indications why (probably
> a mixtore on non 
> lazy and garbage collection)...
> So I reverted to mapping objects, to get the work up
> and running.
> 
> I am not sure how to resolve such an issue in a
> decent manner,
> probably by saving the relational data on the n side
> first
> and then breaking up the relation and setting it
> anew, that way
> hibernate should use the incoming data first...
> 
> but the ideal case would be to just dump the pojos
> in the relation
> and have hibernate figure out, that those pojos come
> from the outside
> and basically are new values...
> 
> What is needed is additional documentation for such
> cases...
> especially once you have to deal with one to many,
> many-to many stuff
> in a webcentric context, things can become really
> messy....
> 
> 
> 
> Werner
> 
> Joshua Davis wrote:
> > Sorry 'bout the head banging! :(  If there's
> anything I can do to help, let
> > me know.
> > 
> > You are absolutely, positively 100% correct about
> 'getting a grip' on
> > Hibernate.
> > 
> > It's actually more fundamental than that: You need
> to have a good
> > understanding of ORM in general in order to use
> Hibernate (or EJB Entities,
> > or TOPLink, etc.) effectively.  For me,
> understanding ORM was a 'leap' that
> > was similar to when I went from structured
> programming to OOP.
> > 
> > [EMAIL PROTECTED]
> > 
> > 
> 
> 

Reply via email to