[jira] Created: (CAY-991) isMandatory() and getMaxLength() should be members of ObjAttributeб not only ClientObjAttribute

From: Andrey Razumovsky (JIRA) ("Andrey)
Date: Thu Feb 28 2008 - 02:07:16 EST

  • Next message: Aristedes Maniatis: "Re: Extended Enumerations"

    isMandatory() and getMaxLength() should be members of ObjAttributeб not only ClientObjAttribute
    -----------------------------------------------------------------------------------------------

                     Key: CAY-991
                     URL: https://issues.apache.org/cayenne/browse/CAY-991
                 Project: Cayenne
              Issue Type: Improvement
              Components: Cayenne Core Library
        Affects Versions: 3.0
                Reporter: Andrey Razumovsky
                Assignee: Andrus Adamchik
                Priority: Minor

    While working on client side (using ROP) or server side, developer my access isMandatory and getMaxLength properties of an ObjAttribute. On server this is usually done by getDbAttribute().isMandatory() and getDbAttribute().getMaxLength(). Since DbEntities are not being sent to client, these two properties are manully set in ClientObjAttribute. So it makes sense to make isMandatory() and getMaxLength() members of ObjAttribute with reference to the same props of DbAttribute for server class, and reference to own ClientObjAttribute class fields for clint implementation.
    This is important for validation, because current validateForSave() method of CayenneDataObject cannot be anyhow applied to client objects. I don't think client objects should by default implement Validating, because validation code would execute twice this way (on client and on server). But still it would be nice to see validation method somewhere (maybe in DataObjectUtils) so that i could check my objects BEFORE commit

    -- 
    This message is automatically generated by JIRA.
    -
    You can reply to this email to add a comment to the issue online.
    



    This archive was generated by hypermail 2.0.0 : Thu Feb 28 2008 - 02:08:17 EST