cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Kienenberger <>
Subject Re: Modification and deletion of data objects
Date Wed, 22 Jul 2009 12:48:05 GMT
If you're asking how you can avoid creating duplicate objects, I guess
you'll need to search through the managed objects of the data context
before creating a new object to insure that there's no other object
with the same primary key.     If you're potentially creating
duplicate "NEW" objects which have no primary key, I'm not sure what
you could do about that.  I guess you'll have to pick something that
uniquely identifies each instance and search through the new objects
list of the data context.   But I think the solution is to not create
a new dataobject each time, but reuse an existing dataobject if a
matching one exists.

On Wed, Jul 22, 2009 at 12:47 AM, sridhar
devatha<> wrote:
> Hi,
> I have view layer, business layer and data access layer. Each have separate
> class for carrying data. But, in data access layer, the object / class used
> for carrying data is respective data objects. I don't send these objects
> beyond my data access layer. Rather I create business objects populated with
> data object data. When the business functions call data access layer for any
> of the CRUD operations, they pass these business objects. I convert these
> business objects to data objects(So, I will create data object every time I
> need to convert business object to data object. So, what happens when the
> two data objects(one dataobject is created while retrieving data. We send
> the data as business object to business layer. one data object is created
> when the user returns the modified  data in the form of business object) of
> the same class exist with the same data? How can I modify and delete the
> respective rows of these data objects? Please answer any body. I did not
> find any example that does the modification.
> Yours Sincerely,
> Devatha Sridhar

View raw message