Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO]How to query the current data through the SQL statement in audit mode?
[CDO]How to query the current data through the SQL statement in audit mode? [message #534761] Thu, 20 May 2010 09:15 Go to next message
Xingxiao Lu is currently offline Xingxiao LuFriend
Messages: 91
Registered: July 2009
Member
Hi, Eike
In audit mode, cdo_revised field record the revised time. So user can
query the current data by "select * from XXX where cdo_revised=0". Right?
But when a CDOObject's container was deleted, the CDOObject's cdo_revised
field wasn't modified. That means user may get some deleted object.
Re: [CDO]How to query the current data through the SQL statement in audit mode? [message #534767 is a reply to message #534761] Thu, 20 May 2010 09:37 Go to previous messageGo to next message
Stefan Winkler is currently offline Stefan WinklerFriend
Messages: 307
Registered: July 2009
Location: Germany
Senior Member
Hi,

Am 20.05.2010 11:15, schrieb lu.xingxiao:
> Hi, Eike
> In audit mode, cdo_revised field record the revised time. So user
> can query the current data by "select * from XXX where cdo_revised=0".
> Right? But when a CDOObject's container was deleted, the CDOObject's
> cdo_revised field wasn't modified. That means user may get some
> deleted object.
Did you try that or is that a hypothesis?

As far as I know, the deletion of the container of an object should lead
to the object's deletion as well.
If this is not the case, can you provide us with a minimal example which
demonstrates the behavior?

Cheers,
Stefan
Re: [CDO]How to query the current data through the SQL statement in audit mode? [message #534786 is a reply to message #534767] Thu, 20 May 2010 10:49 Go to previous messageGo to next message
Xingxiao Lu is currently offline Xingxiao LuFriend
Messages: 91
Registered: July 2009
Member
I'm so sorry for my mistake. It is my software problem. It works fine in the
CDO environment.
Thank you, Stefan.
Re: [CDO]How to query the current data through the SQL statement in audit mode? [message #535096 is a reply to message #534767] Fri, 21 May 2010 09:01 Go to previous messageGo to next message
Xingxiao Lu is currently offline Xingxiao LuFriend
Messages: 91
Registered: July 2009
Member
I have solved the problem above. But I have another problem. How can I get
the same type of data in a resource by SQL statement? Because if CDOObject
have container, its cdo_resource will be zero. So I can't use "SELECT * FROM
XXX WHERE cdo_resource=X AND cdo_revised=0".
Re: [CDO]How to query the current data through the SQL statement in audit mode? [message #535097 is a reply to message #535096] Fri, 21 May 2010 09:21 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 21.05.2010 11:01, schrieb lu.xingxiao:
> I have solved the problem above. But I have another problem. How can I
> get the same type of data in a resource by SQL statement? Because if
> CDOObject have container, its cdo_resource will be zero. So I can't
> use "SELECT * FROM XXX WHERE cdo_resource=X AND cdo_revised=0".
I'm not 100% sure if I understood the question correctly but it's
generally not possible to answer the following *deterministically* :

Is object B *indirectly* contained by object A?

Since CDOResources are "normal" EObjects you can substitute your
resource for object A. In other words, only *directly* contained objects
maintain a dedicated pointer to their container object/resource. Doing
so for all indirectly contained objects as well would cause huge effort
to update this information in case of moves.

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Re: [CDO]How to query the current data through the SQL statement in audit mode? [message #535109 is a reply to message #535097] Fri, 21 May 2010 10:10 Go to previous messageGo to next message
Xingxiao Lu is currently offline Xingxiao LuFriend
Messages: 91
Registered: July 2009
Member
Hi, Eike
Following is a simple example. repo1 is a CDOResource. Object B is contained
by object A. In this case, how can I get all of object B in the repo1 by SQL
statement?


/repo1
|
---A
|
---B
Re: [CDO]How to query the current data through the SQL statement in audit mode? [message #535147 is a reply to message #535109] Fri, 21 May 2010 12:18 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 21.05.2010 12:10, schrieb lu.xingxiao:
> Hi, Eike
> Following is a simple example. repo1 is a CDOResource. Object B is
> contained by object A. In this case, how can I get all of object B in
> the repo1 by SQL statement?
>
>
> /repo1
> |
> ---A
> |
> ---B
As I said, I don't think there exists a closed SQL query that is able to
give you that result because it involves traveling up the containment
hierarchy until you hit a resource. And the length of this path is not
known in advance for any given B.

Cheers
/Eike

----
http://thegordian.blogspot.com
http://twitter.com/eikestepper


Previous Topic:Copy EObject from one list to another
Next Topic:How to indicate the location of .ecore meta-model in the model ?
Goto Forum:
  


Current Time: Thu Apr 25 01:44:48 GMT 2024

Powered by FUDForum. Page generated in 0.03778 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top