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.

Reply via email to