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
Having pruchased Premier Elements vis download, I obviously have not installations disc. After working on a project, I went into audio tools to open SmartSound Quicks. It was not included in the tools menu. I know you can add it to tools if you purch [More]
Hi All, I have a database table(SE11) which has 4 fields (3 key fields + 1 Data Field). I want to derive the 4th field based on the other 3 key fields in my IP. For that I need to write a Characteristics Relationship exit. my query is where do i need [More]
Hi MM gurus, I am trying to upload service entry sheets using bapi's , i checked the note 420334 and its working fine now.But, i want to populate  the workday field also in the service entry sheets, but this field is not getting populated even if i e [More]
So i just got a replacement iphone yesterday, and restored from a backup all my contacts and stuff. I dont have my own laptop so when it comes to music i get all of my mine from other computers...this has never been a problem with my phone or ipods, [More]
I attach my iPhone to my computer through the USB and the cradle. iTunes opens fine and it shows my iPhone. When the iPhone window opens I get the following error. We could not complete your iTunes store request. The network connection timed out. Mak [More]
Hi Friends, We have our R/3 upgradation in near future.  I need to find it out the below things. 1. The Standard Programs which are modified using Access  Keys. 2. The Programs/Transactions where User Exits activated.  Likewise Customer, Menu and Scr [More]
Hi, I've to load data through control_file(.ctl) into oracle table through sqlldr. Oracle 11g, win xp. as soon as I use - sqlldr dss/dss control=orders.ctl I get error or nothing. Text file that is generated after loading fails has the following erro [More]
What sort of performance are people seeing for WLPS? I have tested the demo portal on a Wintel P500+256MB, and a Sun E420R+1GB, and get response times for loading the main page (after JSPs have been compiled) of four and two seconds respectively. Thi [More]
A year ago I bought a Canon 70D and installed the software. A week ago I went to their website and downladed an update for Digital Photo Professional (DPP) from 3.13.?? to 3.14.??. Ran the update and the program stopped working. The error was DPPDLL. [More]
I am trying to install i686 Arch on a recently bought Atom Z3740D tablet modeled VOYO winpad A6. It's preinstalled with Windows 8.1. Atom Z3740D comes with integrated intel gen7 video card. Besides, it has 64GB emmc internal storage, 2GB DDR3L memory [More]