Re: lifecycle callbacks not always fired

2007-03-16 Thread Andrus Adamchik
Yeah, migrating to ObjectContext is now a prerequisite. Won't comment on the specifics now, but the design direction with this was to minimize the number of methods in the ObjectContext interface, so a few DataContext methods didn't make it there. I guess we need to pull to DataObjectUtils

How do I filter on mysql date?

2007-03-16 Thread Frank
Hello, I need to show the last 60 days of records from my MySQL database. This is not working. private List filter() { Calendar c = new GregorianCalendar(); c.set(c.get(Calendar.YEAR),(c.get(Calendar.MONTH)-60), 1, 0, 0, 0); DataContext context =

AW: How do I filter on mysql date?

2007-03-16 Thread Peter Schröder
hi frank, what is the result you get? i would try it that way: Calendar c = new GregorianCalendar(); c.add(Calendar.DATE, -60); SelectQuery select = new SelectQuery(HRApplications.class, ExpressionFactory.between); List records = context.performQuery(select,

Re: How do I filter on mysql date?

2007-03-16 Thread Frank
I am getting between cannot be resolved Thanks Frank - Original Message - From: Peter Schröder [EMAIL PROTECTED] To: user@cayenne.apache.org Sent: Friday, March 16, 2007 10:14 AM Subject: AW: How do I filter on mysql date? hi frank, what is the result you get? i would try it that

Cayenne modeler

2007-03-16 Thread syrinx
I would like to know if it's possible to change the configuration of the modeler in some way, so that a class entity would be generated as a subclass of a my custom class instead of org.apache.cayenne.CayenneDataObject. The reason for this is that I would like to add my own methods to a subclass

Re: Cayenne modeler

2007-03-16 Thread Bryan Lewis
Try: http://cwiki.apache.org/confluence/display/CAYDOC/Setting+DataMap+Defaults syrinx wrote: I would like to know if it's possible to change the configuration of the modeler in some way, so that a class entity would be generated as a subclass of a my custom class instead of

Re: Cayenne modeler

2007-03-16 Thread syrinx
I just find out that there is setting for that in the modeler... ;-) Thanks for your help. Bryan Lewis wrote: Try: http://cwiki.apache.org/confluence/display/CAYDOC/Setting+DataMap+Defaults syrinx wrote: I would like to know if it's possible to change the configuration of the

Running a query over multiple Databases?

2007-03-16 Thread Christian Mittendorf
Hi! I've found the mutiple database example on cayennes homepage: http://cwiki.apache.org/CAY/multiple-databases-example.html That example is a pretty good resemblance of our current problem. What we would like to do is to run a single query over both databases, like i.e. SelectQuery

Re: How do I filter on mysql date?

2007-03-16 Thread Frank
Thanks Peter, I am getting thsi error message: Cannot convert class java.util.GregorianCalendar to SQL type requested due to java.lang.ClassCastException - java.util.GregorianCalendar cannot be cast to java.util.Date Thanks Frank - Original Message - From: Peter Schröder [EMAIL

Re: How do I filter on mysql date?

2007-03-16 Thread Frank
I changed the statement to: SelectQuery select = new SelectQuery(HRApplications.class, ExpressionFactory.betweenExp(appDate, c.getTime(), new GregorianCalendar().getTime())); This seems to have resolved it. Thanks for all your help. Frank - Original Message - From: Peter

Re: Running a query over multiple Databases?

2007-03-16 Thread Andrus Adamchik
Doing a join across DB's generally doesn't work (although it may *appear* to work in simpler cases of matching of FK), as it will require Cayenne to do in memory cartesian product processing. So you'll have to do it manually. (actually sounds like an interesting improvement ... although

Re: Running a query over multiple Databases?

2007-03-16 Thread Ahmed Mohombe
Doing a join across DB's generally doesn't work What about Clustered JDBC ? http://c-jdbc.objectweb.org/ Wouldn't be this a solution? Thanks in advance, Ahmed.

Non persistent attributes

2007-03-16 Thread syrinx
I am looking for a way to declare non persistent attributes using the cayenne modeler? I know that I can add my own attributes manually in the subclasses generated by the modeler, but it would be nice if these attributes could be included in the auto-generated entity class instead. Is this

Re: Running a query over multiple Databases?

2007-03-16 Thread Mike Kienenberger
Certain databases on the same server will also let you do this, if configured correctly. For instance, if all of your databases are on the same Oracle database server, and you've granted appropriate privileges to your current user, it'll work.Mind you, this doesn't help a great deal :-) On