Hi All,

tapestry-hibernate in combination with the BeanEditForm is great, as it allows for simple CRUD applications to be written in no time. Unfortunately it takes quite some manual work to represent relations like OneToMany, ManyToOne and ManyToMany in your application because Tapestry doesn't know how to display a given object and how to map this object to an id. I suggest to add the following behaviour to Tapestry: When editing an object with the BeanEditForm that is a Hibernate entity and there is a reference to another object that is also a Hibernate entity, look for the type of the relation. If it's OneToMany or ManyToMany, render a Palette. If it's ManyToOne or OneToOne, render a Select. Then look at the class of the object at the other end of the relation. It will already have a an id, use this for the SelectModel/ValueEncoder. For the display at the user side, use a method that has a special annotation (this will have to be added) or if the class lacks it, use toString().

What do you think? Am I mispercepting the effort needed to make Hibernate relations work with the BeanEditForm and is the effort needed to build the proposed logic thus disproportional? I'm just wondering because to me this seems to be needed quite frequently but I couldn't find a JIRA issue for this.

Cheers,

Uli

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

Reply via email to