On 9/02/12 8:50 PM, atomix wrote:
Thank a lot Aristedes and Andrus
You both point me very good directions which I don't know before. Cheer,
this should really be written somewhere in the documentation!
You mean the page in the documentation which I linked you to?
@Aristedes :
Now assume we
Thank so much for your help! You saved my day!
I have some more question in the WebApp area, but may be is should be in
another Topic.
Again, THANK ! And wish you the best !
--
View this message in context:
http://cayenne.195.n3.nabble.com/HOW-TO-Creating-a-SelectQuery-has-Expression-like-thi
Ah, you found it yourself :) See my other message explaining chaining
expressions outside and inside the SelectQuery.
On Feb 9, 2012, at 1:56 PM, atomix wrote:
>
> Expression qual = ExpressionFactory.matchExp("toTestresult", aTestresult);
> //qual.andExp(Expression.fromString("get
Ok, am seeing a common error - Expression.andExp creates a new expression,
instead of appending to an existing one (unlike SelectQuery.andQualifier, which
doesn't create a new SelectQuery .. I know this can be confusing).
So this:
> Expression qual = ExpressionFactory.matchExp("t
Expression qual = ExpressionFactory.matchExp("toTestresult", aTestresult);
//qual.andExp(Expression.fromString("getToAnswer.status = status"));
//qual.andExp(Expression.fromString("status = 1"));
query.andQualifier(Expression.fromString("toAnswer.status = status"));
query.andQuali
GENERATED QUERY :
INFO - QueryLogger- SELECT t0.idTestResultAnswer,
t0.status, t0.value, t0.idAnswer, t0.idTestResult FROM testresultanswer t0
WHERE t0.idTestResult = ? [bind: 1->idTestResult:9]
INFO - QueryLogger- === returned 4 rows. - took 0 ms.
return 4;
I don't have the orginal source code here but here is a similar code :
Testresultanswer is the result of an Answer which User fill;
Testresultanswer has RelationShip toAnswer
Testresult has (some) Testresultanswer
Testresultanswer has RelationShip toTestresult
Answer.status = 1 (correct Answer)
On Feb 9, 2012, at 12:58 PM, atomix wrote:
> "hit = toOldBook.hit" (Wrong)
This should work. Could you show how you build your entire query and what SQL
Cayenne generate in the logs?
Andrus
Yes, they have 1-n relationship "toOldBook", I tested
"book.hit = toOldBook.hit" (Wrong)
"Book.hit = toOldBook.hit" (Wrong)
"hit = toOldBook.hit" (Wrong)
but
"toOldBook.hit = 1" ( Correct)
weird
"toOldHell = 1" (nothing name to oldHell of course)
the query still run without any exception???
Thank a lot Aristedes and Andrus
You both point me very good directions which I don't know before. Cheer,
this should really be written somewhere in the documentation!
@Aristedes :
Now assume we can use cgen Template to generate some other Class to suite
our need (Japser intergration), are you an
> so I used Expression.fromString("Book.hit = OldBook.hit");
You are on the right track with this, but you need to get your path's right.
Aside from using aliases which is a separate topic, the general concept of
expression paths is "they all must be relative to the root entity of the
SelectQue
On Feb 9, 2012, at 12:30 PM, Aristedes Maniatis wrote:
>> Hi all, I was quite new with Cayenne, how can I do this :
>>
>> Book extends _Book
>>
>> public static final String DESCRIPTION_PROPERTY = "description";
>> public static final String ID_BOOK_PROPERTY = "idBook";
>> public st
I have another question regarding Expression in Cayenne :
I want my generated SQL like so :
*SELECT **
*FROM *Book B1
*JOIN *OldBook B2 *ON *B1.id= B2.id
*WHERE *B1.hit = B2.hit
so I used Expression.fromString("Book.hit = OldBook.hit");
... but it's not affect anything to the generated SQL, e
On 9/02/12 8:21 PM, atomix wrote:
Hi all, I was quite new with Cayenne, how can I do this :
Book extends _Book
public static final String DESCRIPTION_PROPERTY = "description";
public static final String ID_BOOK_PROPERTY = "idBook";
public static final String LEVEL_PROPERTY = "lev
Hi all, I was quite new with Cayenne, how can I do this :
Book extends _Book
public static final String DESCRIPTION_PROPERTY = "description";
public static final String ID_BOOK_PROPERTY = "idBook";
public static final String LEVEL_PROPERTY = "level";
public static final String PAT
15 matches
Mail list logo