Re: Understanding Entities with Entities in the Tapestry Framework

2012-03-22 Thread Thiago H. de Paula Figueiredo
On Thu, 22 Mar 2012 14:31:09 -0300, IcedDante wrote: When I use the in this scenario I will only get the fields specific to game. Is it best practice here to create a custom form that contains game and address fields or is there a better way? Yep. Or you can use BeanEditor instead of

Re: Understanding Entities with Entities in the Tapestry Framework

2012-03-22 Thread IcedDante
Gotcha. Thx for all the help guys. One more situation: Let's say our game entity can contain an *optional *address. Because the address data may be used in other contexts we keep that information in a separate entity/table: @Entity public class Game { @Id @Validate("required")

Re: Understanding Entities with Entities in the Tapestry Framework

2012-03-21 Thread Kalle Korhonen
On Wed, Mar 21, 2012 at 9:20 AM, IcedDante wrote: >> On Tue, Mar 20, 2012 at 9:44 AM, Beat Durrer wrote: >>> So, all your CreateGame page needs is the user - right? >>> Then let's add an page activation context: >> Current user as the activation context for createGame? Doesn't look >> too secure

Re: Understanding Entities with Entities in the Tapestry Framework

2012-03-21 Thread IcedDante
Kalle Korhonen-2 wrote > > On Tue, Mar 20, 2012 at 9:44 AM, Beat Durrer wrote: >> Since T5 still can't predict the future (pfff!), you need to set the >> reference to the user yourself :) >> There are several ways to do this... >> So, all your CreateGame page needs is the user - right?

Re: Understanding Entities with Entities in the Tapestry Framework

2012-03-21 Thread Beat Durrer
Okay my bad. It's obviously the wrong solution if the user is the current user. I was more thinking along the line of a list->detail connection. 2012/3/20 Kalle Korhonen : > On Tue, Mar 20, 2012 at 9:44 AM, Beat Durrer wrote: >> Since T5 still can't predict the future (pfff!), you need to set th

Re: Understanding Entities with Entities in the Tapestry Framework

2012-03-20 Thread Kalle Korhonen
On Tue, Mar 20, 2012 at 9:44 AM, Beat Durrer wrote: > Since T5 still can't predict the future (pfff!), you need to set the > reference to the user yourself :) > There are several ways to do this... > So, all your CreateGame page needs is the user - right? > Then let's add an page activation contex

Re: Understanding Entities with Entities in the Tapestry Framework

2012-03-20 Thread Beat Durrer
Since T5 still can't predict the future (pfff!), you need to set the reference to the user yourself :) There are several ways to do this... So, all your CreateGame page needs is the user - right? Then let's add an page activation context: @Property private Game game; private User user; onActivat

Re: Understanding Entities with Entities in the Tapestry Framework

2012-03-20 Thread IcedDante
Right, well I understand that. In fact that is how I would do it traditionally in a J2EE environment but my understanding is that some of this should be done auto-magically with the Tapestry/Hibernate combination. So for example, let's say we have a game application where a User can start a game a

Re: Understanding Entities with Entities in the Tapestry Framework

2012-03-20 Thread antalk
This has not so much to do with IOC as more with settting up your database and business logic and tie them together. If you have a logged in user, i assume you'll have some database record of this user ? Then the user will have a unique key (most likely an id). Now when creating a hotel booking y