-
1. Re: JDO query
mcorey Jul 13, 2003 5:21 PM (in response to tuan08)I can't speak for the exception you're getting, but I believe the reason you're not getting any results from the query is because the equality comparison should take the form of a normal java expression -- that is, you should use '==' instead of '='... you're correct in that the single quotes are needed now to surround the string instead of double quotes (or \", actually), but I've submitted a patch to allow the double quotes, so hopefully that will be integrated in an upcoming release.
Should the use of '=' should throw an exception, since it's not actually a valid query, or are there times when a single equals sign is allowable that I'm not thinking of?
m -
2. Re: JDO query
tuan08 Jul 13, 2003 6:32 PM (in response to tuan08)JBossDO DR2 uses =,|,& <>
Warning: if you download DR2 binaries from sf.net, be aware, that there are bugs in JDOQL implementation, i.e. instead of &&, ||, == and != it uses &, |, = and <> correspondingly. This is fixed in CVS version. -
3. Re: JDO query
aloubyansky Jul 14, 2003 4:58 AM (in response to tuan08)The problem is: Could not create an instance of PersistenceCapable: exo.content.persistent.POJO.
At the moment, I use Class.newInstance() (it'll be changed soon).
There could be two problems:
1. can you create an instance of the class with newInstance()?
2. if 1 is ok, then the class is not properly inhanced. I see you use some aop, maybe there are some clashes? How do you deploy?
alex -
4. Re: JDO query
tuan08 Jul 14, 2003 3:18 PM (in response to tuan08)Hi loubyansky ,
Thank for your reply. I cannot use (POJO.class).newInstance() in my interceptor. Probably that is the problem. I also wonder what happen to a serialized POJO . I check your code and I see you use AOP to introduce JBossPersistentCapable interface
14:56:56,340 INFO [STDOUT] request uri = /home
14:56:56,350 ERROR [STDERR] java.lang.InstantiationException: exo.content.persis
tent.POJO
14:56:56,370 ERROR [STDERR] at java.lang.Class.newInstance0(Class.java:293)
14:56:56,380 ERROR [STDERR] at java.lang.Class.newInstance(Class.java:261)
14:56:56,390 ERROR [STDERR] at exo.content.aop.interceptor.PersistentInterce
ptor$GetNodeByUri.execute(PersistentInterceptor.java:123)
14:56:56,410 ERROR [STDERR] at exo.content.aop.interceptor.PersistentInterce
ptor.invoke(PersistentInterceptor.java:62)
14:56:56,430 ERROR [STDERR] at org.jboss.aop.Invocation.invokeNext(Invocatio
n.java:61)
14:56:56,450 ERROR [STDERR] at exo.content.aop.interceptor.CacheInterceptor.
invoke(CacheInterceptor.java:57)
14:56:56,470 ERROR [STDERR] at org.jboss.aop.Invocation.invokeNext(Invocatio
n.java:61)
14:56:56,490 ERROR [STDERR] at org.jboss.aop.ClassAdvisor.invokeMethod(Class
Advisor.java:729)
14:56:56,510 ERROR [STDERR] at org.jboss.aop.ClassAdvisor.invokeMethod(Class -
5. Re: JDO query
tuan08 Jul 14, 2003 4:14 PM (in response to tuan08)I forget to say that I have method save in POJO class and it is just an empty method . I use interceptor to intercept that method :-)
-
6. Re: JDO query
aloubyansky Jul 15, 2003 7:58 AM (in response to tuan08)> I cannot use (POJO.class).newInstance() in my
> interceptor.
You need to fix this problem with newInstance to work with JBossDO. As I mentioned, I'll get rid of using newInstance soon but at the moment it works this way.
> I check your code and I see you use AOP to
> introduce JBossPersistentCapable interface
Yes, the classes are enhanced at deployment time. I am working on making the enhancement closer to the JDO spec.
alex