How to know what the exact problem of CayennRuntimeException was?

2009-03-19 Thread Νίκος Παράσχου
Hello, When I try to commit something and Cayenne cannot communicate with the data node (because internet connection is broken or the DBMS server is down), a CayenneRuntimeException is thrown. A CayenneRuntimeException is also thrown when commiting duplicate entries in PK fields. If I make a com

Re: How can I handle validation exception?

2009-03-12 Thread Νίκος Παράσχου
so I wrote: catch(org.apache.cayenne.validation.ValidationException vex) { // ... } and it works. Sorry for all this trouble caused by my inattention. Thank you, Nikos Στις 12-03-2009, ημέρα Πεμ, και ώρα 11:13 +0200, ο/η Andrus Adamchik έγραψε: > On Mar 12, 2009, at 11:03 AM, Νίκος Παράσχου wrote: >

Re: How can I handle validation exception?

2009-03-12 Thread Νίκος Παράσχου
έρα Πεμ, και ώρα 10:22 +0200, ο/η Andrus Adamchik έγραψε: > On Mar 12, 2009, at 9:41 AM, Νίκος Παράσχου wrote: > > > The problem is that commitChanges() doesn't throw directly a > > ValidationException so I cannot catch it in the catch block (it > > throws a > >

Re: How can I handle validation exception?

2009-03-12 Thread Νίκος Παράσχου
Στις 12-03-2009, ημέρα Πεμ, και ώρα 10:22 +0200, ο/η Andrus Adamchik έγραψε: > On Mar 12, 2009, at 9:41 AM, Νίκος Παράσχου wrote: > > > The problem is that commitChanges() doesn't throw directly a > > ValidationException so I cannot catch it in the catch b

Re: How can I handle validation exception?

2009-03-12 Thread Νίκος Παράσχου
> On Mar 11, 2009, at 11:01 AM, Νίκος Παράσχου wrote: > > > Is there any way to do something like the following: > > > > try { > > context.commitChanges(); > > } > > catch(Some ValidationException thrown earlier) { > > // Get failures list and p

Re: How can I handle validation exception?

2009-03-11 Thread Νίκος Παράσχου
/cayenne/validation/ValidationResult.html > > Use 'getFailures()' to get a list of failures, and analyze them one by > one using ValidationFailure methods. > > Andrus > > On Mar 11, 2009, at 9:36 AM, Νίκος Παράσχου wrote: > > > Thank you Andrus, > >

Re: How can I handle validation exception?

2009-03-11 Thread Νίκος Παράσχου
on is not met, a ValidationException is > thrown.". You should not throw the exception yourself. Just add an > error to the validationResult, and let Cayenne throw it later. > > Andrus > > > On Mar 10, 2009, at 5:03 PM, Νίκος Παράσχου wrote: > > > Hello,

How can I handle validation exception?

2009-03-10 Thread Νίκος Παράσχου
Hello, I implemented validateForSave(ValidationResult validationResult) in one of my ObjEntities. When a specific condition is not met, a ValidationException is thrown. How can I handle this ValidationException? The following doesn't work (I get: ValidationException is not thrown anywhere inside

How to use inExp(...)

2009-03-04 Thread Νίκος Παράσχου
Hello, Could you please guide me how to code a query like the following in cayenne: SELECT * FROM mytable WHERE id IN (SELECT ids FROM myothertable WHERE something); One option is SQLTemplate. How could I do it with ExpressionFactory.inExp(...)? Thank you, Nikos

Re: How to create Meaningful Primary Keys?

2009-02-02 Thread Νίκος Παράσχου
only need to use them for a couple tables then you should look at > DataObjectUtils class. > > > Cheers, > Pierre > > Cordialement, > Pierre Lavignotte > Ingénieur Conception & Développement > http://pierre.lavignotte.googlepages.com > > > On Mon, Feb 2

How to create Meaningful Primary Keys?

2009-02-02 Thread Νίκος Παράσχου
Hello, It is the first time I am using cayenne and I have some questions regarding the primary keys. What I want to do is select some rows of a table where the PK has a specific value. The problem is I can't access the PK. I can specify qualifiers only with the non-PK columns. The PKs I am using