You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cayenne.apache.org by Razumovsky Andrey <hm...@hotmail.ru> on 2008/02/27 11:02:47 UTC
Re[2]: ROP: validation and callbacks
AA> Answering one of the questions, this is correct - there is no
AA> callbacks available on the client.
AA> Andrus
Understood.
About my first question.. I tried to invoke manually validation (forSave) from CayenneDataObject to my client PersistentObject (i.e. to copy-paste the code). Still this didn't work.
First, the ObjEntity.dbEntityName and ObjAttribute.dbAttributePath are nulls while working on client. This is not so bad since i can make some workaround by setting them to needed value.
But the problem is, that client's DataMap, which is accessed by ObjEntity.getDataMap() has no DbEntities loaded, i.e. dbEntityMap is empty, while objEntityMap is correctly fulfilled. So i cannot access constraints described for my DbEntities in DataMap.
Is there any way i can fetch DBEntity object from client?
Thanks,
Andrey
Re: Re[3]: ROP: validation and callbacks
Posted by Andrus Adamchik <an...@objectstyle.org>.
Agreed, totally makes sense. Could you please open a feature request
in Jira:
http://issues.apache.org/cayenne/
Thanks,
Andrus
On Feb 27, 2008, at 7:27 PM, Razumovsky Andrey wrote:
> I've found the answer: it turns out that client 'ObjAttribute'
> descendant, 'ClientObjAttribute' needed validation information. I
> think it is a good idea to make those 'isMandatory' and
> 'getMaxLength' methods members of 'ObjAttribute' so that the same
> validation code would work on client and server (server's objattrs
> will reference to DbAttribute). How do you think?)
>
Re[3]: ROP: validation and callbacks
Posted by Razumovsky Andrey <hm...@hotmail.ru>.
I've found the answer: it turns out that client 'ObjAttribute' descendant, 'ClientObjAttribute' needed validation information. I think it is a good idea to make those 'isMandatory' and 'getMaxLength' methods members of 'ObjAttribute' so that the same validation code would work on client and server (server's objattrs will reference to DbAttribute). How do you think?)