Thanks Thiago, this is the method I ended up implementing. I wasn't sure if there was a better way of handling this. I'm using a custom component that uses a hidden field, do you feel there will be any kind of security risk publishing the concatenated id in the hidden field, or do you think they should be encoded?
On Tue, Feb 28, 2012 at 1:35 PM, Thiago H de Paula Figueiredo [via Tapestry] <ml-node+s1045711n5522779...@n5.nabble.com> wrote: > On Tue, 28 Feb 2012 11:53:43 -0300, Lenny Primak <[hidden > email]<http://user/SendEmail.jtp?type=node&node=5522779&i=0>> > > wrote: > > > Take a look at source code for Tapestry-JPA > > Or just think about it: you have an object, two or more values used as > primary key. Now you need to transform this into a string. Concatenate > them all using some character. Let's say ':'. Now you have your toClient() > > method. For the toValue(), you use string.split(":") and go to the > database to find the object that has these values as its composite primary > > key. > > Short version: same as ValueEncoders for simple primary keys, but a little > > more complex. > > -- > Thiago H. de Paula Figueiredo > Independent Java, Apache Tapestry 5 and Hibernate consultant, developer, > and instructor > Owner, Ars Machina Tecnologia da Informação Ltda. > http://www.arsmachina.com.br > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [hidden > email]<http://user/SendEmail.jtp?type=node&node=5522779&i=1> > For additional commands, e-mail: [hidden > email]<http://user/SendEmail.jtp?type=node&node=5522779&i=2> > > > > ------------------------------ > If you reply to this email, your message will be added to the discussion > below: > > http://tapestry.1045711.n5.nabble.com/Using-coposite-key-with-value-encoder-tp5519520p5522779.html > To unsubscribe from Using coposite key with value encoder., click > here<http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5519520&code=Z2NocmlzdG1hbkBjYXJkYWRkeS5jb218NTUxOTUyMHwxNjMyOTYxMjA3> > . > NAML<http://tapestry.1045711.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml> > -- George Christman www.CarDaddy.com P.O. Box 735 Johnstown, New York -- View this message in context: http://tapestry.1045711.n5.nabble.com/Using-coposite-key-with-value-encoder-tp5519520p5522915.html Sent from the Tapestry - User mailing list archive at Nabble.com.