Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Cannot pass object as parameter into cdoquery
[CDO] Cannot pass object as parameter into cdoquery [message #714453] Wed, 10 August 2011 14:24 Go to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Hi,

I am using the sql syntax for my query language in CDO 3.0

I tried this

UUID etlGrpUUID = (UUID)workItem.getParameter("ETLGroup UUID");
CDOSession sess = EDMCDOSession.getSession();
CDOTransaction transaction = sess.openTransaction();

CDOQuery cdoq = transaction.createQuery("sql", "SELECT CDO_ID
FROM ETLGroup WHERE UUID = :etlGrpUUID") ;
cdoq.setParameter("uuid", etlGrpUUID);
List<ETLGroup> result = cdoq.getResult(ETLGroup.class);

I get

Caused by: java.lang.UnsupportedOperationException: Object not persisted
at
org.eclipse.emf.internal.cdo.query.CDOQueryImpl.adapt(CDOQueryImpl.java:143)
at
org.eclipse.emf.internal.cdo.query.CDOQueryImpl.createQueryInfo(CDOQueryImpl.java:129)
at
org.eclipse.emf.internal.cdo.query.CDOQueryImpl.createQueryResult(CDOQueryImpl.java:66)
at
org.eclipse.emf.internal.cdo.query.CDOQueryImpl.getResult(CDOQueryImpl.java:77)
at
com.yambina.edm.edmengine.workitems.ETLGroupWorkItemHandler.executeWorkItem(ETLGroupWorkItemHandler.java:39)


If I replace the parameter with a String that matches the name of the
ETLGroup it works. E.G.
createQuery("sql", "SELECT CDO_ID FROM ETLGroup etl WHERE name = :name") ;
So how come it does not work for my UUID object?

Thx.

David
Re: [CDO] Cannot pass object as parameter into cdoquery [message #714475 is a reply to message #714453] Wed, 10 August 2011 15:35 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Hi David,

That sounds like RFE 259330: [Query] Support transient objects to be passed between client <-> server,
https://bugs.eclipse.org/bugs/show_bug.cgi?id=259330

Note that there has been no progress on it since almost 3 years.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper



Am 10.08.2011 16:24, schrieb David Wynter:
> Hi,
>
> I am using the sql syntax for my query language in CDO 3.0
>
> I tried this
>
> UUID etlGrpUUID = (UUID)workItem.getParameter("ETLGroup UUID");
> CDOSession sess = EDMCDOSession.getSession();
> CDOTransaction transaction = sess.openTransaction();
>
> CDOQuery cdoq = transaction.createQuery("sql", "SELECT CDO_ID FROM ETLGroup WHERE UUID = :etlGrpUUID") ;
> cdoq.setParameter("uuid", etlGrpUUID);
> List<ETLGroup> result = cdoq.getResult(ETLGroup.class);
>
> I get
>
> Caused by: java.lang.UnsupportedOperationException: Object not persisted
> at org.eclipse.emf.internal.cdo.query.CDOQueryImpl.adapt(CDOQueryImpl.java:143)
> at org.eclipse.emf.internal.cdo.query.CDOQueryImpl.createQueryInfo(CDOQueryImpl.java:129)
> at org.eclipse.emf.internal.cdo.query.CDOQueryImpl.createQueryResult(CDOQueryImpl.java:66)
> at org.eclipse.emf.internal.cdo.query.CDOQueryImpl.getResult(CDOQueryImpl.java:77)
> at com.yambina.edm.edmengine.workitems.ETLGroupWorkItemHandler.executeWorkItem(ETLGroupWorkItemHandler.java:39)
>
>
> If I replace the parameter with a String that matches the name of the ETLGroup it works. E.G.
> createQuery("sql", "SELECT CDO_ID FROM ETLGroup etl WHERE name = :name") ;
> So how come it does not work for my UUID object?
>
> Thx.
>
> David


Re: [CDO] Cannot pass object as parameter into cdoquery [message #714556 is a reply to message #714475] Wed, 10 August 2011 20:29 Go to previous messageGo to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Hi,

Maybe not quite the same. What I need to do is take the refId we have
for a UUID we store in a BPMN2 workflow xml and get CDO to retrieve the
actual object in the repo we have for where this UUID matches that of
the one in the repo. What we do is take this String representation and
create a new UUID object, this is what I am using in the query. We only
have sql, we did not use hql because there are limitations. If we had
hql I suppose we could do something like

createQuery("sql", "SELECT CDO_ID FROM
ETLGroup etl WHERE etl.UUID.msb = :msb AND etl.UUID.lsb = :lsb") ;
where we get the lsb Long and the msb Long from the UUID we have created.

How should we go about that given we only have sql and our objects are
all uniquely identified by the UUID objects?

Thx.

David

On 10/08/11 16:35, Eike Stepper wrote:
> Hi David,
>
> That sounds like RFE 259330: [Query] Support transient objects to be
> passed between client <-> server,
> https://bugs.eclipse.org/bugs/show_bug.cgi?id=259330
>
> Note that there has been no progress on it since almost 3 years.
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>
> Am 10.08.2011 16:24, schrieb David Wynter:
>> Hi,
>>
>> I am using the sql syntax for my query language in CDO 3.0
>>
>> I tried this
>>
>> UUID etlGrpUUID = (UUID)workItem.getParameter("ETLGroup UUID");
>> CDOSession sess = EDMCDOSession.getSession();
>> CDOTransaction transaction = sess.openTransaction();
>>
>> CDOQuery cdoq = transaction.createQuery("sql", "SELECT CDO_ID FROM
>> ETLGroup WHERE UUID = :etlGrpUUID") ;
>> cdoq.setParameter("uuid", etlGrpUUID);
>> List<ETLGroup> result = cdoq.getResult(ETLGroup.class);
>>
>> I get
>>
>> Caused by: java.lang.UnsupportedOperationException: Object not persisted
>> at
>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.adapt(CDOQueryImpl.java:143)
>>
>> at
>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.createQueryInfo(CDOQueryImpl.java:129)
>>
>> at
>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.createQueryResult(CDOQueryImpl.java:66)
>>
>> at
>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.getResult(CDOQueryImpl.java:77)
>>
>> at
>> com.yambina.edm.edmengine.workitems.ETLGroupWorkItemHandler.executeWorkItem(ETLGroupWorkItemHandler.java:39)
>>
>>
>>
>> If I replace the parameter with a String that matches the name of the
>> ETLGroup it works. E.G.
>> createQuery("sql", "SELECT CDO_ID FROM ETLGroup etl WHERE name =
>> :name") ;
>> So how come it does not work for my UUID object?
>>
>> Thx.
>>
>> David
Re: [CDO] Cannot pass object as parameter into cdoquery [message #714563 is a reply to message #714453] Wed, 10 August 2011 21:17 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal KaracaFriend
Messages: 854
Registered: July 2009
Senior Member
David Wynter wrote on Wed, 10 August 2011 10:24
Hi,
CDOQuery cdoq = transaction.createQuery("sql", "SELECT CDO_ID
FROM ETLGroup WHERE UUID = :etlGrpUUID") ;
cdoq.setParameter("uuid", etlGrpUUID);


Shouldn't the parameter names match? I.e. in your query, the parameter is called 'etlGrpUUID' and you are setting 'uuid'...
Re: [CDO] Cannot pass object as parameter into cdoquery [message #714618 is a reply to message #714563] Thu, 11 August 2011 05:45 Go to previous messageGo to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
On 10/08/11 22:17, Erdal Karaca wrote:
> David Wynter wrote on Wed, 10 August 2011 10:24
>> Hi,
>> CDOQuery cdoq = transaction.createQuery("sql", "SELECT CDO_ID FROM
>> ETLGroup WHERE UUID = :etlGrpUUID") ;
>> cdoq.setParameter("uuid", etlGrpUUID);
>
>
> Shouldn't the parameter names match? I.e. in your query, the parameter
> is called 'etlGrpUUID' and you are setting 'uuid'...
>
Sorry, this was just an example, it would have throw a different
exception if this was the actual code.

David
Re: [CDO] Cannot pass object as parameter into cdoquery [message #714629 is a reply to message #714556] Thu, 11 August 2011 06:29 Go to previous messageGo to next message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 10.08.2011 22:29, schrieb David Wynter:
> Hi,
>
> Maybe not quite the same. What I need to do is take the refId we have for a UUID we store in a BPMN2 workflow xml and
> get CDO to retrieve the actual object in the repo we have for where this UUID matches that of the one in the repo.
> What we do is take this String representation and create a new UUID object, this is what I am using in the query. We
> only have sql, we did not use hql because there are limitations. If we had hql I suppose we could do something like
>
> createQuery("sql", "SELECT CDO_ID FROM
> ETLGroup etl WHERE etl.UUID.msb = :msb AND etl.UUID.lsb = :lsb") ;
> where we get the lsb Long and the msb Long from the UUID we have created.
>
> How should we go about that given we only have sql and our objects are all uniquely identified by the UUID objects?
I must be misunderstanding something. Why isn't it sufficient to either set one query parameter to s string form of your
UUID or two parameters to the two long values?

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> Thx.
>
> David
>
> On 10/08/11 16:35, Eike Stepper wrote:
>> Hi David,
>>
>> That sounds like RFE 259330: [Query] Support transient objects to be
>> passed between client <-> server,
>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=259330
>>
>> Note that there has been no progress on it since almost 3 years.
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>
>> Am 10.08.2011 16:24, schrieb David Wynter:
>>> Hi,
>>>
>>> I am using the sql syntax for my query language in CDO 3.0
>>>
>>> I tried this
>>>
>>> UUID etlGrpUUID = (UUID)workItem.getParameter("ETLGroup UUID");
>>> CDOSession sess = EDMCDOSession.getSession();
>>> CDOTransaction transaction = sess.openTransaction();
>>>
>>> CDOQuery cdoq = transaction.createQuery("sql", "SELECT CDO_ID FROM
>>> ETLGroup WHERE UUID = :etlGrpUUID") ;
>>> cdoq.setParameter("uuid", etlGrpUUID);
>>> List<ETLGroup> result = cdoq.getResult(ETLGroup.class);
>>>
>>> I get
>>>
>>> Caused by: java.lang.UnsupportedOperationException: Object not persisted
>>> at
>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.adapt(CDOQueryImpl.java:143)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.createQueryInfo(CDOQueryImpl.java:129)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.createQueryResult(CDOQueryImpl.java:66)
>>>
>>> at
>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.getResult(CDOQueryImpl.java:77)
>>>
>>> at
>>> com.yambina.edm.edmengine.workitems.ETLGroupWorkItemHandler.executeWorkItem(ETLGroupWorkItemHandler.java:39)
>>>
>>>
>>>
>>> If I replace the parameter with a String that matches the name of the
>>> ETLGroup it works. E.G.
>>> createQuery("sql", "SELECT CDO_ID FROM ETLGroup etl WHERE name =
>>> :name") ;
>>> So how come it does not work for my UUID object?
>>>
>>> Thx.
>>>
>>> David
>


Re: [CDO] Cannot pass object as parameter into cdoquery [message #714773 is a reply to message #714629] Thu, 11 August 2011 13:06 Go to previous messageGo to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Hi,

I could use 2 long parameters except isn't the ability to navigate to
etl.UUID.msb and et.UUID.lsb, this ability is specific to hql type only?

The second form of using UUID as a string form would only work if CDO
stored that, from my reading of the documents it stores internal
reference the UUID object, which itself stores the msb and lsb so our
generated refId thar uses hexadecimal characters to encode the msb and
lsb is not stored anywhere.

So my model is ETLGroup had a field called UUIS, an object that has 2
fields lsb and msb, which as Long. I have a refId from which I can
create a shiny new UUID and from that get the lsb and msb. So if there
is a way of using sql type syntax with the msb and lsb that would be
great. The CDO docs don't really show this except for those using hql.

Thx.

David

On 11/08/11 07:29, Eike Stepper wrote:
> Am 10.08.2011 22:29, schrieb David Wynter:
>> Hi,
>>
>> Maybe not quite the same. What I need to do is take the refId we have
>> for a UUID we store in a BPMN2 workflow xml and get CDO to retrieve
>> the actual object in the repo we have for where this UUID matches that
>> of the one in the repo. What we do is take this String representation
>> and create a new UUID object, this is what I am using in the query. We
>> only have sql, we did not use hql because there are limitations. If we
>> had hql I suppose we could do something like
>>
>> createQuery("sql", "SELECT CDO_ID FROM
>> ETLGroup etl WHERE etl.UUID.msb = :msb AND etl.UUID.lsb = :lsb") ;
>> where we get the lsb Long and the msb Long from the UUID we have created.
>>
>> How should we go about that given we only have sql and our objects are
>> all uniquely identified by the UUID objects?
> I must be misunderstanding something. Why isn't it sufficient to either
> set one query parameter to s string form of your UUID or two parameters
> to the two long values?
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> Thx.
>>
>> David
>>
>> On 10/08/11 16:35, Eike Stepper wrote:
>>> Hi David,
>>>
>>> That sounds like RFE 259330: [Query] Support transient objects to be
>>> passed between client <-> server,
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=259330
>>>
>>> Note that there has been no progress on it since almost 3 years.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>> Am 10.08.2011 16:24, schrieb David Wynter:
>>>> Hi,
>>>>
>>>> I am using the sql syntax for my query language in CDO 3.0
>>>>
>>>> I tried this
>>>>
>>>> UUID etlGrpUUID = (UUID)workItem.getParameter("ETLGroup UUID");
>>>> CDOSession sess = EDMCDOSession.getSession();
>>>> CDOTransaction transaction = sess.openTransaction();
>>>>
>>>> CDOQuery cdoq = transaction.createQuery("sql", "SELECT CDO_ID FROM
>>>> ETLGroup WHERE UUID = :etlGrpUUID") ;
>>>> cdoq.setParameter("uuid", etlGrpUUID);
>>>> List<ETLGroup> result = cdoq.getResult(ETLGroup.class);
>>>>
>>>> I get
>>>>
>>>> Caused by: java.lang.UnsupportedOperationException: Object not
>>>> persisted
>>>> at
>>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.adapt(CDOQueryImpl.java:143)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.createQueryInfo(CDOQueryImpl.java:129)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.createQueryResult(CDOQueryImpl.java:66)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.getResult(CDOQueryImpl.java:77)
>>>>
>>>>
>>>> at
>>>> com.yambina.edm.edmengine.workitems.ETLGroupWorkItemHandler.executeWorkItem(ETLGroupWorkItemHandler.java:39)
>>>>
>>>>
>>>>
>>>>
>>>> If I replace the parameter with a String that matches the name of the
>>>> ETLGroup it works. E.G.
>>>> createQuery("sql", "SELECT CDO_ID FROM ETLGroup etl WHERE name =
>>>> :name") ;
>>>> So how come it does not work for my UUID object?
>>>>
>>>> Thx.
>>>>
>>>> David
>>
Re: [CDO] Cannot pass object as parameter into cdoquery [message #715088 is a reply to message #714629] Fri, 12 August 2011 10:20 Go to previous messageGo to next message
David Wynter is currently offline David WynterFriend
Messages: 4624
Registered: July 2009
Senior Member
Hi,

This works

SELECT CDO_ID FROM ETLGroup WHERE EXISTS (SELECT * FROM UUID WHERE msb =
:msb AND lsb = :lsb AND ETLGroup.UUID = UUID.CDO_ID)

You just need to look at the internal database structures to be able to
query successfully with sql.

Thx.

David


On 11/08/11 07:29, Eike Stepper wrote:
> Am 10.08.2011 22:29, schrieb David Wynter:
>> Hi,
>>
>> Maybe not quite the same. What I need to do is take the refId we have
>> for a UUID we store in a BPMN2 workflow xml and get CDO to retrieve
>> the actual object in the repo we have for where this UUID matches that
>> of the one in the repo. What we do is take this String representation
>> and create a new UUID object, this is what I am using in the query. We
>> only have sql, we did not use hql because there are limitations. If we
>> had hql I suppose we could do something like
>>
>> createQuery("sql", "SELECT CDO_ID FROM
>> ETLGroup etl WHERE etl.UUID.msb = :msb AND etl.UUID.lsb = :lsb") ;
>> where we get the lsb Long and the msb Long from the UUID we have created.
>>
>> How should we go about that given we only have sql and our objects are
>> all uniquely identified by the UUID objects?
> I must be misunderstanding something. Why isn't it sufficient to either
> set one query parameter to s string form of your UUID or two parameters
> to the two long values?
>
> Cheers
> /Eike
>
> ----
> http://www.esc-net.de
> http://thegordian.blogspot.com
> http://twitter.com/eikestepper
>
>
>>
>> Thx.
>>
>> David
>>
>> On 10/08/11 16:35, Eike Stepper wrote:
>>> Hi David,
>>>
>>> That sounds like RFE 259330: [Query] Support transient objects to be
>>> passed between client <-> server,
>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=259330
>>>
>>> Note that there has been no progress on it since almost 3 years.
>>>
>>> Cheers
>>> /Eike
>>>
>>> ----
>>> http://www.esc-net.de
>>> http://thegordian.blogspot.com
>>> http://twitter.com/eikestepper
>>>
>>>
>>>
>>> Am 10.08.2011 16:24, schrieb David Wynter:
>>>> Hi,
>>>>
>>>> I am using the sql syntax for my query language in CDO 3.0
>>>>
>>>> I tried this
>>>>
>>>> UUID etlGrpUUID = (UUID)workItem.getParameter("ETLGroup UUID");
>>>> CDOSession sess = EDMCDOSession.getSession();
>>>> CDOTransaction transaction = sess.openTransaction();
>>>>
>>>> CDOQuery cdoq = transaction.createQuery("sql", "SELECT CDO_ID FROM
>>>> ETLGroup WHERE UUID = :etlGrpUUID") ;
>>>> cdoq.setParameter("uuid", etlGrpUUID);
>>>> List<ETLGroup> result = cdoq.getResult(ETLGroup.class);
>>>>
>>>> I get
>>>>
>>>> Caused by: java.lang.UnsupportedOperationException: Object not
>>>> persisted
>>>> at
>>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.adapt(CDOQueryImpl.java:143)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.createQueryInfo(CDOQueryImpl.java:129)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.createQueryResult(CDOQueryImpl.java:66)
>>>>
>>>>
>>>> at
>>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.getResult(CDOQueryImpl.java:77)
>>>>
>>>>
>>>> at
>>>> com.yambina.edm.edmengine.workitems.ETLGroupWorkItemHandler.executeWorkItem(ETLGroupWorkItemHandler.java:39)
>>>>
>>>>
>>>>
>>>>
>>>> If I replace the parameter with a String that matches the name of the
>>>> ETLGroup it works. E.G.
>>>> createQuery("sql", "SELECT CDO_ID FROM ETLGroup etl WHERE name =
>>>> :name") ;
>>>> So how come it does not work for my UUID object?
>>>>
>>>> Thx.
>>>>
>>>> David
>>
Re: [CDO] Cannot pass object as parameter into cdoquery [message #715957 is a reply to message #715088] Tue, 16 August 2011 05:46 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6682
Registered: July 2009
Senior Member
Am 12.08.2011 12:20, schrieb David Wynter:
> Hi,
>
> This works
>
> SELECT CDO_ID FROM ETLGroup WHERE EXISTS (SELECT * FROM UUID WHERE msb = :msb AND lsb = :lsb AND ETLGroup.UUID =
> UUID.CDO_ID)
>
> You just need to look at the internal database structures to be able to query successfully with sql.
Indeed. CDO ships with a small HTTP server called CDOServerBrowser that can display various server infos (incl. all DB
tables if used with DBStore). The default CDOServerApplication starts it if the system property
org.eclipse.emf.cdo.server.browser.port is set to, e.g., 7777.

Cheers
/Eike

----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper


>
> Thx.
>
> David
>
>
> On 11/08/11 07:29, Eike Stepper wrote:
>> Am 10.08.2011 22:29, schrieb David Wynter:
>>> Hi,
>>>
>>> Maybe not quite the same. What I need to do is take the refId we have
>>> for a UUID we store in a BPMN2 workflow xml and get CDO to retrieve
>>> the actual object in the repo we have for where this UUID matches that
>>> of the one in the repo. What we do is take this String representation
>>> and create a new UUID object, this is what I am using in the query. We
>>> only have sql, we did not use hql because there are limitations. If we
>>> had hql I suppose we could do something like
>>>
>>> createQuery("sql", "SELECT CDO_ID FROM
>>> ETLGroup etl WHERE etl.UUID.msb = :msb AND etl.UUID.lsb = :lsb") ;
>>> where we get the lsb Long and the msb Long from the UUID we have created.
>>>
>>> How should we go about that given we only have sql and our objects are
>>> all uniquely identified by the UUID objects?
>> I must be misunderstanding something. Why isn't it sufficient to either
>> set one query parameter to s string form of your UUID or two parameters
>> to the two long values?
>>
>> Cheers
>> /Eike
>>
>> ----
>> http://www.esc-net.de
>> http://thegordian.blogspot.com
>> http://twitter.com/eikestepper
>>
>>
>>>
>>> Thx.
>>>
>>> David
>>>
>>> On 10/08/11 16:35, Eike Stepper wrote:
>>>> Hi David,
>>>>
>>>> That sounds like RFE 259330: [Query] Support transient objects to be
>>>> passed between client <-> server,
>>>> https://bugs.eclipse.org/bugs/show_bug.cgi?id=259330
>>>>
>>>> Note that there has been no progress on it since almost 3 years.
>>>>
>>>> Cheers
>>>> /Eike
>>>>
>>>> ----
>>>> http://www.esc-net.de
>>>> http://thegordian.blogspot.com
>>>> http://twitter.com/eikestepper
>>>>
>>>>
>>>>
>>>> Am 10.08.2011 16:24, schrieb David Wynter:
>>>>> Hi,
>>>>>
>>>>> I am using the sql syntax for my query language in CDO 3.0
>>>>>
>>>>> I tried this
>>>>>
>>>>> UUID etlGrpUUID = (UUID)workItem.getParameter("ETLGroup UUID");
>>>>> CDOSession sess = EDMCDOSession.getSession();
>>>>> CDOTransaction transaction = sess.openTransaction();
>>>>>
>>>>> CDOQuery cdoq = transaction.createQuery("sql", "SELECT CDO_ID FROM
>>>>> ETLGroup WHERE UUID = :etlGrpUUID") ;
>>>>> cdoq.setParameter("uuid", etlGrpUUID);
>>>>> List<ETLGroup> result = cdoq.getResult(ETLGroup.class);
>>>>>
>>>>> I get
>>>>>
>>>>> Caused by: java.lang.UnsupportedOperationException: Object not
>>>>> persisted
>>>>> at
>>>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.adapt(CDOQueryImpl.java:143)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.createQueryInfo(CDOQueryImpl.java:129)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.createQueryResult(CDOQueryImpl.java:66)
>>>>>
>>>>>
>>>>> at
>>>>> org.eclipse.emf.internal.cdo.query.CDOQueryImpl.getResult(CDOQueryImpl.java:77)
>>>>>
>>>>>
>>>>> at
>>>>> com.yambina.edm.edmengine.workitems.ETLGroupWorkItemHandler.executeWorkItem(ETLGroupWorkItemHandler.java:39)
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> If I replace the parameter with a String that matches the name of the
>>>>> ETLGroup it works. E.G.
>>>>> createQuery("sql", "SELECT CDO_ID FROM ETLGroup etl WHERE name =
>>>>> :name") ;
>>>>> So how come it does not work for my UUID object?
>>>>>
>>>>> Thx.
>>>>>
>>>>> David
>>>
>


Previous Topic:[xbase/xcore] infer and refer to constructor
Next Topic:Xcore, xbase and EObject literals
Goto Forum:
  


Current Time: Fri Apr 19 14:50:52 GMT 2024

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

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

Back to the top