Kevin,

I, too, would recommend using a new entity to resolve the many-to-many into a pair of one-to-many relationships. But please don't ask me to justify that statement - I came to the conclusion too long ago to remember the reasons. All I remember is that it's less pain in the long run (and you'll keep more of your hair).

grep JumpStart for many-to-many and you'll find the UserRole example.

Regards,
Geoff

On 04/01/2009, at 4:16 AM, Jonathan Barker wrote:

Kevin,

Almost three years ago, I climbed learning curves for T4 (and Hivemind),
Spring, Acegi, and Hibernate simultaneously.  It was... challenging.

Make sure you really need ManyToMany with Hibernate. Often, two OneToMany
relationships will suffice.

Take your time with Hibernate. See how the different options result in
different implementations (in the database) of relationships. Reverse
engineer an existing database and see what Hibernate gives you. I think I know Hibernate pretty well, and yet I keep the reference guide up whenever I'm working with it - even with content-assist. Oh, and take some time to figure out how you are going to implement equals() and hashCode() - those
are important questions with Hibernate.

Have fun!

Jonathan

-----Original Message-----
From: dok...@phideaux.rawfeddogs.net
[mailto:dok...@phideaux.rawfeddogs.net] On Behalf Of Kevin Monceaux
Sent: Saturday, January 03, 2009 00:58
To: Tapestry users
Subject: RE: T5 newbie books/tutorials and a couple of questions?

Jonathan,

On Fri, 2 Jan 2009, Jonathan Barker wrote:

Search the list for the Jumpstart application. It has been kept right up to date with the latest release of T5. I think you will find it has many good examples. (Also, search the Wiki for titles with "Tapestry5".
It's not all up to date, but there's some great stuff.)

It looks like there's plenty there to keep me busy for a while.  It
doesn't seem to have any ManyToMany relation examples. The following in
the Jumpstart root directory:

# find . -name "*.java" -exec grep ManyToMany {} \;

returns nothing.  But, it does have a few OneToMany relations, which
should be close enough to get me started.

Searching the wiki for ManyToMany also turned up next to nothing.  It
turned up a couple of pages, but they just mentioned OneToMany,
ManyToMany, etc., in passing without any actual code examples of the
annotations.  I was sure I saw a few examples in the tapestry5 doc
section. Is the main Tapestry site indexed by Google? A Google search
for:

    site:tapestry.apache.org/tapestry5 ManyToMany

got no hits at all.

I'm not sure you really want a grid for what you have displayed, but
rather
Loops generating the tables on your own. Because you have both column
and
row groupings (COLSPAN,ROWSPAN) on the pages you listed, I'm not sure
how
you would do things like apply sorting.

I suspected that might be the case.  The grid component is impressive
enough as it is. If it could "magically" handle multi-level hierarchical
data I might not know how to act.  :-)  With Django I'm currently
generating those pages with nested loops.  Before Django I gave
ASP.NET(via Mono on a FreeBSD box) a try and was generating those pages by
dumping the data to XML and using XSLT.

Hibernate has a learning curve all its own, so if you're not familiar with it, take some time to learn it on its own. At least be prepared for some hair-pulling if you try to learn both Tapestry and Hibernate at
the same time.

I'm a relative newbie to Tapestry, Hibernate, and Java. It might be a good thing that I have very little hair. I figure if I'm going to go bald some day I might as well beat nature to it. I alternate between clipping it as short as clippers will clip it, and shaving my head. I've let it
grow out a bit for winter.  Maybe I should shave it before Hibernate
drives me to trying to pull what little I have left out.  :-)



Kevin
http://www.RawFedDogs.net
http://www.WacoAgilityGroup.org
Bruceville, TX

Si hoc legere scis nimium eruditionis habes.
Longum iter est per praecepta, breve et efficax per exempla!!!


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to