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
Every time I load Media Encoder it crashes when "Loading Looks3_AE10.plugin. I have no idea where to even start with trying to fix this. I just formated my primary drive and am in the process of reinsalling and setting everything up. So I just got al [More]
I plugged in my ipod (60gig) and I got the message that no disk found. I installed the lastest ipod software, still same prob. I then reset the ipod and same problem I uninstalled itunes and reinstalled it and it worked for a couple of hours and then [More]
Hi, I generated an ADDM Report on my DB for the time when the DB performance was very slow. Below are some lines from it: RECOMMENDATION 1: SQL Tuning, 15% benefit (28820 seconds) ACTION: Run SQL Tuning Advisor on the SQL statement with SQL_ID "725bg [More]
When sighning in and out of an ios device some of the icloud data from the icloud account used to sighned in stays even after sighning out. Is it the same on pc icloud and if so how do you delete it. ( This is the online site by the way.)Hi turintest [More]
"Failed to Export to Microsoft Excel. There was an unexpected problem." So, other programs like Able2Extract PDF converted 8 and CogniView PDF2XL can make the conversion. Why AdobeExportPDF can not?the file is http://enlinea.guadalajara.gob.mx/c [More]
Hey guys, So here I am, looking at instructions on how to upload music onto my iPhone. I tried something, then decided I didn't want that song, so I deleted it. Now everytime I open Music, it goes to that song I deleted; even when I check Settings > [More]
I have Prem. Elements 12.  I am trying to add audio media.  I know where the audio files are located (using GET INFO while in iTunes), and when I try to add certain audio files, some are accepted and some are not.  In one case, when I opened a partic [More]
Hi,all. My printer is Zebra ZM400 300dpi,I created a new output device 'TestDevice' and use the Lzeb3 Device type. In my smartofrms i used the Zebra command to rotated text.Now the smartforms counld not print chinese characters but '#' instead.(style [More]
Hi, i have a 7905 phone with SIP firmware. I want to use this phone with our call manager as SCCP. I have changed tftp server adress on 7905, but it coulnd't download it's own firmware. it's still working with sip firmware. call manager can access to [More]
Hi guys..! I wrote a program that creates an Xml file when the program terminates. I want to write some kind of Listener that will listen the directory where the file is created. So, what I want is....as soon as the file is created, I want to be able [More]