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 just switched from using a powerbook to an iPad + microkeyboard for my work computer (I'm freelance and need to bring my own device wherever I go), and I love the size and weight of it compared to a laptop. What I am glitching on is the fact that I [More]
I had to format my PC but I did a complete backup of all my itunes folder, now that my pc is restored and all my music files are in place, the digital booklets i had purchased off itunes are no longer visible in the itunes library. I have to go to th [More]
My Dynadock had been working fine until yesterday, when my network connection started acting flaky.  Any website that uses HTTPS or any tools that use SSH will fail constantly.  As soon as I disabled the "dynadock Ethernet" LAN connection and sw [More]
Hi Gurus, We had stock inconsistencies heavily. We went to SAP and they suggested to select re read stocks option in CFC9. When we selected the option and ran batch job for CCR, it was running morethan 2 days and completed. Ususally it will complete [More]
Hi experts, I have a problem with the view BuPaSelectCPforCustomer. I have two differnt users with different profiles. User1 have the default profile and user2 have a customized profile. Now I enter an account which have 3 contact persons. With user1 [More]
Hi all, I need to do some personalization in this Oracle EBS Form  - Purchasing Super User -> Receiving  -> Receipts -> Lot Entry I must ensure that evry record entered on that form has a unique value in the column Lot Number. Can anybody advise [More]
Hi Gurus, i have a litte problem with format of my business graphic. I used a simple series and set the format in the designer to 0,000.00 - it works for amounts greater zero. But otherwise (if the amount zero) the x-axis shoh the labe 000.00 - but i [More]
Hi , I want to add text in between two lines on the header of the Payslip. I have added the text in the text modules , but am not able to view it  . How can i rectify this . Thanks, RohitHi, Just create a "Single Fields" in betn the two lines on [More]
How do I remove photo albums synced from computer without losing them on the computerIf you un-check them in iTunes on the computer then sync, they should be removed from the phone but remain on the computer. Why would you completely delete the folde [More]
Hi, relating to capture conversion and to the code below: public static void reverse(List<?> list) {           rev(list);      private static <X> void rev(List<X> l) {      }Am I right in saying that the <X> (or whatever else for t [More]