Re: Cayenne code generation - pointers requested

2010-01-28 Thread Adrian Wiesmann
Thanks Andrus. The cgen docs explain the process but the code pointers are going to be super helpful. We wrote our own code generator. This might be of help... http://somap.svn.sourceforge.net/viewvc/somap/codegen/src/ Cheers, Adrian

Re: Cayenne code generation - pointers requested

2010-01-28 Thread John Armstrong
The way I am handling 'what gets mapped' is with a BeanFactory class that uses Dozer to do basic mapping on a per CDO/Bean basis. BeanUtils could do this but BeanUtils blows up a lot more easily. Dozer handles serializable attributes automatically for us. Case by case I add logic to my BeanFactory

Re: EJBQL: clause for count() statement?

2010-01-28 Thread Andrey Razumovsky
thanks, but how then can i order the list by paintings count? 2010/1/28 Andrus Adamchik > This should work: > > select a, count(p) from Artist a join a.paintings p group by a having > count(p) > 5 > > Andrus > > > > On Jan 28, 2010, at 12:47 PM, Andrey Razumovsky wrote: > > Hi, >> >> Imagine

Re: EJBQL: clause for count() statement?

2010-01-28 Thread Andrus Adamchik
This should work: select a, count(p) from Artist a join a.paintings p group by a having count(p) > 5 Andrus On Jan 28, 2010, at 12:47 PM, Andrey Razumovsky wrote: Hi, Imagine I need to select all artists with their painting count. That's how I do that select a, count(p) from Artist

EJBQL: clause for count() statement?

2010-01-28 Thread Andrey Razumovsky
Hi, Imagine I need to select all artists with their painting count. That's how I do that select a, count(p) from Artist a inner join a.paintings p group by a I need to select all artists that have >5 paintings... how can I do that? I thought I need something like aliases, but our EJBQL doesn't su

Re: Individual Object Caching

2010-01-28 Thread Andrus Adamchik
Yes, a query refreshes cached objects (unless the query itself is served from cache). Andrus On Jan 28, 2010, at 11:59 AM, Nishant Neeraj wrote: Hi, I am a bit confused on the way Cayenne handles object-cache. It sounds to me that object-cache gets invalidated [1], whenever a call like

Individual Object Caching

2010-01-28 Thread Nishant Neeraj
Hi, I am a bit confused on the way Cayenne handles object-cache. It sounds to me that object-cache gets invalidated [1], whenever a call like this takes placeĀ  loadMenu(){... SelectQuery query = new SelectQuery(PaintingType.class, ...); return (List)context.performQuery(query); } Now, there are

Re: Cayenne code generation - pointers requested

2010-01-28 Thread Andrey Razumovsky
Cool, didn't know about BeanModel.. I'm never used GXT. We've wrote quite a lot of code in GWT-Ext (and it supports JSON).. This is raw and abandoned project, and I hate it more and more each day (and also I will never anymore use wrapper library, like SmartGWT). Still I've been unable to persuade

Re: Cayenne code generation - pointers requested

2010-01-28 Thread John Armstrong
I'm using GXT which has a pretty strong preference for its own 'BeanModel' (thin wrapper around a javabean that understands GXT) for grid population etc. That (in my mind) means I am either serializing Cayenne Models -> JSON -> BeanModels or just going from Cayenne Model -> BeanModel so I decided

Re: Using an Escaped LIKE Clause

2010-01-28 Thread Andrus Adamchik
Hi Andrew, By straightforward I meant from a general framework architecture standpoint, i.e. no changes to the processing pipeline, just extending what we have. Yes, a minimal implementation would be adding escape char to PatternMatchNode and then tweak the QualifierTranslator to actually

Re: Cayenne code generation - pointers requested

2010-01-28 Thread Andrey Razumovsky
I'm currently using Cayenne and GWT. I think the question should be if it is worth it to convert server beans to client beans. Do you really need data objects on client side? With a lack of reflection they cannot be easily used in UI. I think this only produces unneeded convertion. What I do is con

Re: Using an Escaped LIKE Clause

2010-01-28 Thread Andrew Lindesay
Hi Andrus; Thanks for that -- I am fairly new to actually using Cayenne. Are you able to give me any pointers? As a guess I think I would need to add the escape character to "PatternMatchNode" and then modify something around "DataObjectMatchTranslator" or "QualifierTranslator" to turn that i

Re: Cayenne code generation - pointers requested

2010-01-28 Thread John Armstrong
Thanks Andrus. The cgen docs explain the process but the code pointers are going to be super helpful. Down the rabbit hole.. John- On Thu, Jan 28, 2010 at 12:23 AM, Andrus Adamchik wrote: > cgen (Ant or Maven variety) support custom templates and generation modes > (either one run per DataMap or

Re: Cayenne code generation - pointers requested

2010-01-28 Thread Andrus Adamchik
cgen (Ant or Maven variety) support custom templates and generation modes (either one run per DataMap or one run per ObjEntity): http://cayenne.apache.org/doc30/cgen.html http://cayenne.apache.org/doc30/maven2-cgen.html So you can definitely implement class generation around Cayenne mapping

Re: Using an Escaped LIKE Clause

2010-01-28 Thread Andrus Adamchik
Lachlan is correct. Escaping is only supported in EJBQL now: SELECT p FROM Painting p WHERE p.paintingTitle LIKE 'X_' ESCAPE 'X' Should be more or less straightforward to add it to Expressions I guess. Andrus On Jan 28, 2010, at 4:06 AM, Lachlan Deck wrote: Hi Andrew, On 28/01/2010