Sitemap

Amicuk Programming Answers

Can JDO Query be extended

-0001-11-30   Views:0

Advertisement

Hi, Does KODO provide a hook to extend the javax.jdo.Query's implementation class from KODO, they way it supports extending PersistenceManagerImpl? Most of my objects need to be transferred over wire, and they should have their identity accessible fr

Hi,
Does KODO provide a hook to extend the javax.jdo.Query's implementation
class from KODO, they way it supports extending PersistenceManagerImpl?
Most of my objects need to be transferred over wire, and they should have
their identity accessible from the object itself when it goes in a
different jvm. If I can extend the Query's execute() methods to populate
their id in the object itself, that would look like a cleaner and
transparent solution.
Suggestions?
Regards,
Manoj

The replay answer
Advertisement
Manoj-
JDO does a lazy fetching of objects A, when B.getA() is called. I need to
have "id" member variable of A also populated before returning the
collection.Hmm ... do you mean that you just want to populate an "id"
field when you load an instance of A? If that is all you are trying to
do, then I would suggest having your class implement
javax.jdo.InstanceCallbacks and doing that work in jdoPostLoad().
In article <[email protected]>, Manoj Prakash wrote:
class A{
int id
// other primitive members
Class B{
int id
HashSet a // collection of A
public Collection getA(){
return a;
When I query objects of class B, I can use the FacadeQuery the way you
suggested, to populate "id" member variable of B.
JDO does a lazy fetching of objects A, when B.getA() is called. I need to
have "id" member variable of A also populated before returning the
collection.
I wanted to know what method(s) if overridden in PersistenceManagerImpl
would provide me hook to do that.
Regards,
Manoj
Marc Prud'hommeaux wrote:
Manoj-
I'm not sure what you mean. Can you post some pesudo-code of what you
are trying to accomplish?
In article <[email protected]>, Manoj Prakash wrote:
Great, thanks.
What methods if overridden from PersistenceManagerImpl can take care of
the case of populating Ids for the objects in a Collection, during lazy
fetching?
Marc Prud'hommeaux wrote:
Manoj-
You can't directly extend our Query implementation, but you could always
extend PersistenceManagerImpl and extend all the methods that return
queries to wrap them in a ManojQueryFacade class that just does what you
want in the execute method before delegating the call to the internally
held query. I think that should work OK (although I haven't actually
tried it).
In article <[email protected]>, Manoj Prakash wrote:
Hi,
Does KODO provide a hook to extend the javax.jdo.Query's implementation
class from KODO, they way it supports extending PersistenceManagerImpl?
Most of my objects need to be transferred over wire, and they should
have
their identity accessible from the object itself when it goes in a
different jvm. If I can extend the Query's execute() methods to populate
their id in the object itself, that would look like a cleaner and
transparent solution.
Suggestions?
Regards,
Manoj
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com
Marc Prud'hommeaux [email protected]
SolarMetric Inc. http://www.solarmetric.com

Go to See the other 8 answers

Can JDO Query be extended

Category:DefaultRelease time:-0001-11-30Views:130

Hi, Does KODO provide a hook to extend the javax.jdo.Query's implementation class from KODO, they way it supports extending PersistenceManagerImpl? Most of my objects need to be transferred over wire, and they should have their identity accessible fr[More]

Query.setRange() not available on standard javax.jdo.Query interface?

Category:DefaultRelease time:-0001-11-30Views:130

Hi Kodo people, I'm trying out Kodo 3.2.0, most specifically for the spiffy new setRange() functionality. However, I'm somewhat confused because while the docs clearly indicate that the setRange() method is available on the standard javax.jdo.Query i[More]

JDO Query does not seem to be executed at all

Category:DefaultRelease time:-0001-11-30Views:130

I have the following JDO query and it returns empty collection but it should return some records. I set "SQL=TRACE" in kodo.properties file and traced the log file. This query does not seem to generate SQL statement at all. Other JDO method gene[More]

Help with JDO query

Category:DefaultRelease time:-0001-11-30Views:130

I'm currently using Kodo 3.0.2, MySQL 4.0.17 and MySQL driver 3.0.10 I have written a JDO filter like this. Where all the criteria are properly grouped into parenthesis. However, the generated SQL statements removed/ignored the parenthesis. I may hav[More]

Bad SQL for JDO query

Category:DefaultRelease time:-0001-11-30Views:130

Kodo JDO EE 2.3 RC1 (with InstantDB on JBoss 3.0 on JDK 1.3.1 on Mac OS X 10.1.5) generates wrong SQL for a JDO query with a parameter. Essentially (unimportant details omitted) I have the following: 2 associated persistence-capable classes public cl[More]

Saving JDO Query?

Category:DefaultRelease time:-0001-11-30Views:130

Hi, Can i save a JDO query (written using JDOQL) to a file or DB and later retrieve it back and execute the query ?Is this possible? In our application,we provide "search" function .The user can save a search query along with the criteria given.[More]

JDO: Query returns too many results.

Category:DefaultRelease time:2015-10-11Views:130

Hello, I want to get some DO-Entities from an empty table. When I execute the query I retrieve more than 2 000 000 000 results what is definitly too much for an empty table. The DO has an one-to-many relationship to another class and a many-to-one re[More]

Warning in query in Extended Syntax Check

Category:DefaultRelease time:2015-10-11Views:130

Hi all, I perform Extended Syntax Check. It generates following warning for the query: - In "SELECT SINGLE....", the WHERE condition for the key field "MATNR" does not test for equality. Therefore the single record in question may not[More]

Query on Extended Idoc Types

Category:DefaultRelease time:-0001-11-30Views:130

Hi all, I am new to ALE/IDOC'S but has bit idea on that. I was asked to extend an Extension Idoc type. Kindly give me the steps on that. Also if an Idoc type is released, then how can i modify that idoc for segment insertion? Kindly reply me, i m in[More]

How to query for extended ASCII characters in column value

Category:DefaultRelease time:-0001-11-30Views:130

Hi All Sorry if this has been answered before. I tried searching but none of them seems to work for me. I am trying to search for inverted ? in my column. I am using the following query select * from table_name where regexp_like (description , '¿' )D[More]

Query regarding extended transport control

Category:DefaultRelease time:-0001-11-30Views:130

Hi All, I read about extended transport control and I get very confused.What exactly it means. I have a 3 clients in my DEV system xx0,xx1,xx2, only one in QA and one in PRD. Now when searched I found.. 'when you release a change request in DEV Clien[More]

Hot
Hi, How do I get the euro symbol € to display in Flash from PHP file created in DW ?. It does not display it properly. I have simplified the PHP code I have is: <?php $msgtoflash = "This is the Euro Symbol &#8364"; print ("&Datab [More]
It maybe to do with the registry cleaner. Most people seem to fix it by using restore points which I just realised I hadn't created any beforehand....don't lecture me on it I already know, stupid move. Using Vista. I also know I have a lot of stuff l [More]
When I try to install Adobe Acrobat Standard 9, I get an error that says I need IE6 or greater and the install will not finish.  I have IE9.  Why doesn't it recognize that I have IE9, and how do I get around this?  Thanks. Update:  I have since insta [More]
Hello Adobe Community, I know that with past versions, changing the word that was used to preview fonts ('sample') was not possible (in 2006 anyway). But, because I believe CS4 came out in 08, I was wondering if this was a feature that had been imple [More]
Is there any other way that I can use the Bluetooth Module with out buying the complete AirPort Extream/Bluetooth Kit and without using the Bluetooth Dongle? Mac Mini 1.42 MHZ Combo Drive   Mac OS X (10.3.9)   512 MB DDR 80 GB HDYou mentioned the onl [More]
Do any of of you know whether or not it is possible to import music into iPad, like when you can import pictures, without the use of iTunes ( I don't have a computer)? I have music on my phone and on USB flash drives. ThnxIf you are in America then y [More]
I am trying to set up our production multi-server farm.  I have run the configuration wizard after creating the configuration database manually using powershell, and Central Administration site loads fine when opened directly from the application ser [More]
Today I ordered the "Free Solaris Express Developer Edition DVD": "For a limited time, Sun is offering a Solaris Express Developer Edition DVD for x86 platforms mailed to you at no charge." (http://developers.sun.com/sxde/download.jsp) [More]
Does anyone know the configuration page of Time Capsule so that we can enter port number?That's kinda odd, since I'm using Leopard too I don't think it's that. What version of Airport Utility are you using, the latest is 5.1.3, so if it doesn't say t [More]
I had a short in my cord while updatiing to IOS 6 so the update was interrupted. when it was done i had no pics PLEASE HELP!!Restore from your most recent backup. You did backup your device beofre updating the software, right?Read other 2 answers [More]