Gaet wrote:
  Hi,

  For those who are using Hibernate with struts, just a simple question :

  How do you do to display the value of a composite key when using for instance, the 
tag <bean:write>

  Example :
  ---------
  A table "Person" has a composite key "lastname" and "firstname".
  So, with hibernate mapping, accessing the property lastname of a person 
object (p) will be : p.comp_id.lastname

  So the property lastname is not directly in the class person but in a "sub-class"...so how to 
display "lastname" in <bean:write> tag??

Well, assuming that Person has a getter for the composite key object that contains lastname and firstname, then you'd do the same thing in bean:write as you're doing above: person.comp_key.lastname would be the equivalent of calling getComp_key().getLastname() on Person.

L.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to