Sitemap

Amicuk Programming Answers

IsNull and In-memory Query.

-0001-11-30   Views:0

Advertisement

I have two objects: Item with attribute:itemId, statusCollection (many-to-one bi-directional map) ItemStatus with attributes:statusId, startDate, thruDate and item (one-to-many bidirectional map) The issue is that the query in memory, using isNull in

I have two objects:
Item with attribute:itemId, statusCollection (many-to-one bi-directional map)
ItemStatus with attributes:statusId, startDate, thruDate and item (one-to-many bidirectional map)
The issue is that the query in memory, using isNull in the expression, does not seem to work. In the code below, I use the same expression to read from Db and from the memory. The Db query returns some rows but the in-memory does not. Am I doing something wrong? Is that a known issue? I am using 9.0.4.
     //Query DB
     ReadAllQuery queryDb = new ReadAllQuery();
     ExpressionBuilder ebDb = new ExpressionBuilder();
     Expression whereDb = ebDb.anyOf("statusCollection").get("thruDate").isNull();
     queryDb.setReferenceClass(Item.class);
     queryDb.setSelectionCriteria(whereDb);
     Vector strongRef = (Vector) SessionHome.getSession().executeQuery(queryDb);
     // Load all the status in memory ...
     for (Iterator it = strongRef.iterator(); it.hasNext(); ((Item)it.next()).getStatusCollection().size());
     System.out.println("Querying DB:" + strongRef.size());
     //Query Mem
     ReadAllQuery queryMem = new ReadAllQuery();
     ExpressionBuilder ebMem = new ExpressionBuilder();
     Expression whereMem = ebMem.anyOf("statusCollection").get("thruDate").isNull();
     queryMem.setReferenceClass(Item.class);
     queryMem.setSelectionCriteria(whereDb);
     queryMem.checkCacheOnly();
     Vector strongRef2 = (Vector) SessionHome.getSession().executeQuery(queryMem);
     System.out.println("Querying Mem:" + strongRef2.size());

The replay answer
Advertisement
Hi Paulo,
I meant to post this yesterday.
If you replace:
Expression whereMem = ebMem.anyOf("statusCollection").get("thruDate").isNull();
with:
Expression whereMem = ebMem.anyOf("statusCollection").get("thruDate").equal(ebMem.value(null));
your query should conform in-memory. Also beware anyOf(..).in(...) and anyOf(...).equal(obj) where obj is not null.

Go to See the other 3 answers

IsNull and In-memory Query.

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

I have two objects: Item with attribute:itemId, statusCollection (many-to-one bi-directional map) ItemStatus with attributes:statusId, startDate, thruDate and item (one-to-many bidirectional map) The issue is that the query in memory, using isNull in[More]

In-Memory Query execution mode rendering results but "both" as execution mode do not.

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

Hi, I am facing this strange issue of fetching some rows based on my view criteria. I delete some rows and make them as inactive. Then I search for those rows by using filter as "inactive" rows. I get the result as expected. But then, if I enter[More]

P67A-GD55 Memory Query

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

In February I am emabarking on a new PC/System build. The Motherboard will be the MSI P67A-GD55, with the Intel I-5 2500K unlocked CPU. PSU will be the Corsair HX650. My question is, if I put in 2x2GB DDR3 Dual Channel Corsair Memory sticks with a vo[More]

Export- Import to Memory Query

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

Hello Everyone, I have 2 FMs where one exports variable to memory and other FM imports the same . FM A:   DATA: id    TYPE c LENGTH 10 VALUE 'SWITCH_WO',         id1   TYPE c LENGTH 10 VALUE 'SWITCH_OP'.   EXPORT   g_workorder from g_workorder  TO ME[More]

X58M memory query

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

Planning a new build with the X58M MB. The intention is to use the i7 920CPU and 12GB memory consisting of the Corsair HX3X12G1333C9 XMS3 6 X 2GB. The system will be used for graphics rendering for my daughters University tasks which entails running[More]

Can we conform in memory via in memory only query?

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

Can we conform in memory via in memory only query? In other words, if I do in memory query only, does the query result will represent changes done in the UOW so far? I thought that was the case, but then I saw this comment in EclipseLink 1.1.3, class[More]

Memory requirements for query

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

Hello, is there some way that i could find out how much memory query will demand to be succesfuly executed ? Maybe to see how much each object referenced in the FROM part of the clause is big ? requirementsok , thank you. By big i ment would it help[More]

Isnull not working proper

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

Hi, In this table : id    amount 01     1000 query : select isnull(amount,0)  from tbl  where id ='01' output :1000 but in this query : query : select isnull(amount,0)  from tbl  where id ='02' output : why here isnull not return 0The query is read i[More]

DB Adapter Query - Polling using nested select

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

When polling a table to initiate a BPEL process, can I use a nested select in the expression.The visual expression builder does not currently support this so you need to specify the raw sql directly. If you use the DeletePollingStrategy there is a wa[More]

Query sometimes returns no results

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

In our project, we have some EJB2.1 CMP beans with a redirect finder. The Redirect finder uses Toplink expression to build a ReadAllQuery. The expression provides a kind of findByExample implementation which toplink does not support for Entity beans.[More]

cache-query-results question

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

I have another post for general descriptor tag information but I do have a specific question. In a project I am looking at I see: <cache-usage> check cache by primary key </cache-usage> <cache-query-results>false</cache-query-results&[More]

Hot
I have written a program in C, and now i should write the same for java. The problem is, i can't find a type called WHND (windowshandler). The second problem is, that i should convert the command sendmessage (Sends a Message to an other application). [More]
I have a playlist on the left side of my iTunes schreen wil several audio items in it. However, when I click on my iPhone Sync Music section, the playlist is not listed. My other playlists are there. Any ideas why it is missing, and will not sycn wit [More]
Three websites in my bookmarks toolbar have stopped appearing in my history list. When I go to them they no longer remember posts I looked at previously.Do you use private browsing with those sites?Read other 4 answers [More]
If I connect my iphone to my mac, it automatically shows up on the locations in the Aperture import menu.  However, I want to import some photos from a friend's iphone and when I connect it to y mac, it will not "find" that iphone.  How can I im [More]
I upgraded from iPhoto '06. My photos are not the same. Some seem washed out. When I click on some to make them larger I get a black exclamation point, no photo. I can't edit them. They don't sore properly into Events.Just remember there is no need e [More]
I would like to be a drop-down menu that once you have select an item, would open another drop down with sub-items of the inherent checked earlyThank you Josh for your answer to the OP. I understand how it works, but would appreciate a clarification [More]
Hi All, I have just updated my phone from N95 to an N96, I now find that I'm having trouble with some calls giving the other person an echo. (not all calls) The other problem is the sound goes all pixilated (if thats the right word) every few minnute [More]
Hi, I wanted to know where the failed logins are logged in Solaris 10. On Solaris 8 it is /var/adm/loginlog. On solaris 10 however I find that this file is non existent. Please help RgdsHello, first look your /etc/default/login file. make sure SYSLOG [More]
Anytime I try to upload the new Adobe Flash Player Update, the installer won't download any further than 25% or 30% through. And this annoys me a lot because now it is impossible for me to view any videos, and I think I may not have access to some ce [More]
in the last week i have purchased 2 of the Epson workforce 633 all in one printer, for 2 separate imac desktops, both have been installed and function perfectly except that one WILL print all documents of any file type, the other (mine ) will also pr [More]