Re: [question]: Auto PK Generation and Still have the PK available in ObjectMode

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Wed Oct 15 2003 - 11:44:06 EDT

  • Next message: johannes schmidt: "error in entity creation"

    Hi Laszlo,

    On Wednesday, October 15, 2003, at 08:17 AM, Laszlo Spoor wrote:

    > <bean:write name="usr" property="id"/>

    But you can define a method "getId()" in your Java class for User
    instead of a JSP (I assume "usr" variable corresponds to a class named
    "User" or similar), thus making "id" a new read-only property, that
    will work with Struts tag above:

    public class User extends _User {
        ...
        public Object getId() {
           return this.getObjectId().getIdSnapshot().get("xyz");
        }
    }

    On a side note, the demand for this method is so high, that we might
    need to add framework support for it.

    Andrus



    This archive was generated by hypermail 2.0.0 : Wed Oct 15 2003 - 11:44:07 EDT