Qualified query on map values

Hi,
I would like to do something like the following in JDOQL:
map["key"].attribute == "bla"
The candidate class has a map "_map", using a String as key and a PC (at
its best of unknown type) as value. This PC has an attribute "_attribute".
So I would like to perform queries on the value objects which are
qualified by a certain key. I don't think this is possible with standard
JDOQL, is it? What about a query extension, e.g.
map.ext:qualify("key").attribute == "bla"
Is this feasible?
Cheers,
Andreas

You're right that this is not possible under standard JDOQL, and Kodo
currently doesn't have any support for it. In fact, we have it logged
as a bug, because we think it's a feature that we should support, even
if it is not in the JDO spec:
http://bugzilla.solarmetric.com/show_bug.cgi?id=539
Yes, you can probably implement this with a query extension:
"_map.ext:get(key) == value"
The closest sample we have is the source for the
kodo/jdbc/query/GetColumn.java extension included in your Kodo
distribution. Instead of using getClassMapping(), you should use
getFieldMapping(), and cast the field mapping to a
kodo.jdbc.meta.AbstractMapFieldMapping. That should allow you to get
the value column.

Similar Messages

  • Query to map values between tables

    Hi,
    I'm trying to group data from the following three tables to create a new table.
    Fields in bmf: account_no, trans_date
    cmf: account_no, balance_due
    acct_map: account_no, external_id
    The fields I want in my new table are : external_id, account_no, balance_due.
    When I use query 1, without the external_id column, it works fine and populates the data correctly. But when i try query 2, it creates a blank table. Will be great if anyone can point out my mistake and correct my query.
    Many thanks!
    novice.
    Query 1:
    create table paid as
    select bmf.account_no, sum(cmf.balance_due) postpaid_balance
    from bmf, cmf
    where to_char(bmf.trans_date, 'YYYY MM DD') = '1996 08 14' and
    bmf.account_no = cmf.account_no
    group by bmf.account_no
    Query 2:
    create table paid as
    select bmf.account_no, sum(cmf.balance_due) postpaid_balance, acct_map.external_id
    from bmf, cmf, acct_map
    where to_char(bmf.trans_date, 'YYYY MM DD') = '1996 08 14' and
    bmf.account_no = cmf.account_no and
    acct_map.account_no = bmf.account_no
    group by bmf.account_no, acct_map.external_id

    Sorry, perhaps i should have been more clear.
    create table accounts (column1 number, .... etc);
    insert into accounts () values (......);This allows users to see what your queries return, right now we have NO idea what your data looks like.
    Also, expected output of your queries...you saying "it doesn't do what i want" doesn't help us much when we don't know what you want (this is where, using the sample data you provide to us, you show us what the result should be).
    I'm not saying by any means you HAVE to do this, i'm just telling you that it's much more likely you'll get the help you are looking for if you do, that's all.
    Try to put yourself in our shoes, being asked a question with no context, near no information and nothing to go on. Would you jump at the chance to guess and fumble around, or would you ask more questions to save time in the end?

  • Issue facing : Deletion of Qualified Look up field value : Using Import Map

    Hi All,
    We are having qualified multi-valued look up field in the main table. Using import map for the main table record update, we are trying to delete the qualified look up field value. But it is not working.
    Please guide on how you have achieved this.
    One approach is to supply NULL value, though I am not sure or have tried this.
    Regards,
    Ganga

    Hi Ganga,
    I assume that you are trying to delete the Qualifier values for the Qualified look up table. The only possibility is to pass the Null values to the already Existing records in the Main table. Please note that if you are passing one Null value only one record will get deleted. So you will have to pass the Null values equivalent to the number of values for the Multi Valued Qualified table.
    Kind Regards,
    Thamizharasi N

  • How to force readObejct query with PK value to go to DB?

    The default behaviour for read-object queries with a PK value is to use the cache and not go to the database. How can we change this behaviour?
    We have cases that a row was deleted by some other process not through toplink, but the corresponding object still in the cache and if you use the readObject query with PK value, the object will be returned as result.
    Thanks in advance,

    There are several mechanisms to disable caching in TopLink. Note that disabling caching will affect your performance.
    In 9.0.4 you can use:
    - You can configure you cache type to use a WeakIdentityMap to ensure that only referenced objects are cached.
    - On descriptor you can call disableCacheHits() and alwaysRefreshCache() in code or click these options on the Caching/Identity tab in the Mapping Workbench.
    - Or to explicitly remove a deleted object from the cache uses session.removeFromIdentityMap(), but you must ensure there are no other objects referencing it.
    In 10.1.3 you can also use:
    - On descriptor you can call setIsIsolated(true) in code, or select isolated in the Caching tab in the Mapping Workbench.
    - Alternatively you can set a CacheInvalidationPolicy on your descriptor to ensure objects are not cached for longer than a specified time, or invalidated daily.
    - Or to explicitly invalidate a deleted object use, session.getIdentityMapAccessor().invalidateObject()

  • Query for MAP Calculation - Price Control ind V and S

    SAP Guru's
    Query regarding MAP Calculation Logic
    Scenario:
    *I have one material xyz
    1. It is split valuated material,
    2. Two valuation types with diff price control indicators
    3. Batch Management is also activated on this material.*
    Follwoing is the Material Master Accounting1 View :
    Vauation Type     Price Control     Total Value     Qty     MAP                  Batch     
         ZA1          V                     610835.00             37     16509.05(V)          01
         ZB1          S                     0                  1     20000.00(S)          02
    but when we are running MM03 w/o Valuation Type Accounting 1 View
    is showing MAP as 16074.60 i.e. 610835.00/38
    Diff. Reports Output------>
    MB5L - List of Stock Values: Balances --> Output
    ValArea          Total Stock          Total Value
    A101               1                          0
    A101               37                          610835.00
    Net-->               38                  610835.00
    MB52 - Display Warehouse Stocks
    Check Box - Display Batch Stocks
    Condition1: When Display Batch Stocks is selected on main screen of MB52
    Mat.     Palnt      Sloc      Unrestricted     Stck in Transit          Total Value
    xyz     A101     0010      0                    30                       482238.00
    XYZ     A101     0010      7                    0                       115563.00
    xyz     A101     0010      1                    0                        0
    This is not correct result as Total Values is 597801.00 only      
    Condition2: When Display Batch Stocks is not selected on main screen of MB52
    Mat.     Palnt     Sloc     Unrestricted     Stck in Transit          Total Value
    xyz     A101     0010         0                  30                       482238.00
    XYZ     A101     0010         8                   0                       128597.00
    This is correct result as Total Values is 610835 .00 only
    So my query on above issue is :
    1. How System is including 1 Qty of Std Price Control for MAP calculation?
    As per my understanding MAP is only for Price Control V indicator Materials Stock
    2. Whats the difference between these two report output from MM03 Accounting
       view?
    Thanks

    hi Animesh,
    For Split Valuated Material at header level Price control is always "V" i.e. Moving average price reagrdless of the Price control you have given for different valuation types.
    Due to this you are getting these kind of results. Please visit the following link for more information
    http:///saphelp/EN/8f/d1de34e4cb2300e10000009b38f83b/frameset.htm
    Check it and revert back.
    Regards,
    Jay
    Edited by: SAP_MM on Dec 4, 2008 10:19 AM

  • Get Map values using loops

    Hi,
    With a vector I can have a loop and to get the values with a index.
    Vector vec = new Vector()
    for(int idx=0; idx>vec.size(); idx++){
        System.out.println(vec.get(idx).toString());
    }I can do something similar with a map ? in other words have a loop and get the map values.
    I know that the map a other java.util Collections don't have a
    public Object get(int index)
    method as Vector, but How I can simulate this in a map.
    Some idea ??
    thanks

    what about using an iterator?
    Iterator it = map.values.iterator();
    while (it.hasNext()) {
    Object o = it.next();
    hf,
    dani

  • Report using either query or direct value

    Hi,
    I'm using Reports 6i.
    I'm having a report in which most of the content is static text. only 1 or 2 values i'm fetching from database to fill up the content.
    I have a requirement like, if the user directly supply this value, then i have to run this report with the provided value without querying.
    In case they dont suppy the values, then the report should query and take values from the database.
    Whether such a report is possible?
    Thanks
    Divya

    Hi,
    Thanks for the reply.
    But if P_Param is not null then the report should take the parameter value and run the report.
    Suppose my report contents is like this
    This is a test report run by USERWhere user is the field.
    If i supply user say as 'Divya' , then i should get the output as
    This is a test report run by DivyaIf i didn supply user, and instead another parameter say id is supplied, then it should query and take the username and run
    Both should happen in single report.
    As you suggested, if the user param is null, then nothing comes.
    This is just a sample case i told. my original req involves more than one param
    Thanks

  • BW Query variable default value put in Crystal report variable question

    Why BW Query variable default value put in Crystal report variable for BO InfoView to open crystal report.
    I using Analyzer to open bw query,variables had default value ,but crystal report can't had variable default value ,and can't search variable  value.
    pho:
    [http://file.itpub.net/f/e38876ad4f6efb7e73980488e7d71f8d/4ae940e9/day_091029/20091029_2b04da1232144feba180OrB23SNvXtoT.gif/p/1.gif]
    [http://file.itpub.net/f/d93ddfe61e0eaf80429726c61f1a02ff/4ae940e9/day_091029/20091029_3211ffe04bf0302fbab5FRKnbwmH80p7.gif/p/BW_QUERY_Crystal.gif]
    Edited by: flying on Oct 29, 2009 8:20 AM

    I Know what to do .
    but Crystal report date variable value are Garbage characters "###".
    PHO:
    [http://file.itpub.net/f/39a8510104476707ae21c945db93ecba/4ae97949/day_091029/20091029_32dcbb7e7d99141483aesJ9KBJHXN0Kj.gif/p/2.gif]

  • MDM Exception: Key mapping value must be unique. You cannot overwrite key

    "ServerException: Key mapping value must be unique. You cannot overwrite key mapping values."
    I received such exception when code tried to manipulate Key Mappings of the record.
    error was not happen on mdm 5.5 but on 7.1 it sometimes appears.
    What is probable reason of this?
    How to resolve this ?
    Code is approximate so:
                                         String[] keys = keyMapping.getKeys();
                        if (recordKeyMapping.containsKeyMapping(remoteSystem)) {
                    recordKeyMapping.replace(remoteSystem, keys);
              else {
                   recordKeyMapping.addKeyMapping(keyMapping);
              //Persist
              targetRecord.update();
    //where methods are:
         public void replace(RemoteSystem remoteSystem, String[] keys) {
              KeyMapping keyMapping = getKeyMapping(remoteSystem);
              if (keyMapping == null) throw new IllegalArgumentException("Can't update keys: key mapping for the system '" + remoteSystem + "' is not found");
              else {
                   keyMapping.setKeys(keys);
         public void addKeyMapping(KeyMapping keyMapping) {
              RemoteSystem remoteSystem = keyMapping.getRemoteSystem();
              for(int i = 0; i < keyMapping.size(); i++) {
                   addKey(remoteSystem, (String) keyMapping.get(i));
    Edited by: Vladimir Grigoryev on Oct 5, 2010 11:26 AM

    Hello -
    I am not sure on that coding part. but is it like are you trying to retrive Key Mapping from Memory accelerator. Here this information always needs to be read from Database.
    I am sure you also maintained  the required attribute for key mapping as in Property in Console should be set as "Yes" and other relevant things properly .
    Here also go through the below link for more insight from tools perspective.
    http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/30843106-5539-2b10-75a9-da483911b0d9
    http://help.sap.com/javadocs/mdm/sp06/com/sap/mdm/data/KeyMapping.html
    It may help
    Rgds
    Deep

  • IChart & Fixed Query /w scooter values in legend (xMII 11.5.1)

    Hello all, this is my first post here and I hope that I can get some help.
    Environment Details:
    Server: Windows 2003, xMII 11.5.1, Java Plugin 1.4.2_13
    Client: Windows XP, IE6, Java Plugin 1.4.2_13
    My problem is that I cannot get scooter values to show in the legend with a simple iChart & Fixed Query.  At least not without more problems.  Let me explain...
    The following chart & query does not show scooter values in the legend (values are shown in the upper left hand corner for the selected item though):
    <applet name="ProcessDataApplet" height="421" width="1259" code="iChart" archive="illum8.zip" codebase="/Illuminator/Classes" "mayscript="true">
    <param name="Mode" value="FixedQuery" />
    <param name="QueryTemplate" value="Allvac/AMP/QueryTemplate" />
    <param name="DisplayTemplate" value="Allvac/AMP/DisplayTemplate" />
    <param name="Server" value="MONROE_VAR_ARMS" />
    <param name="Query" value="SELECT [TIMESTAMP],[ACTUAL_FURNACE_CURRENT],[ACTUAL_FURNACE_VOLTAGE],[RAM_VELOCITY] FROM [PRODUCT_HEADER] INNER JOIN [PRODUCT_AUDIT_DATA] ON ([PRODUCT_HEADER].[PRODUCT_KEY] = [PRODUCT_AUDIT_DATA].[PRODUCT_KEY]) WHERE [PRODUCT_HEADER].[PRODUCT_KEY] = '525cb615-1b15-4b07-aa7c-9f1df9c47ba3' AND [TIMESTAMP] >= '02/27/2008 03:21:22' AND [TIMESTAMP] <= '02/27/2008 15:14:34' ORDER BY [TIMESTAMP] ASC" />
    <param name="RowCount" value="8558" />
    <param name="ChartType" value="Line" />
    <param name="AxisValueColumn" value="TIMESTAMP" />
    <param name="XAxisFontSize" value="10" />
    <param name="LegendWidth" value="40" />
    <param name="LegendFontSize" value="10" />
    <param name="GlobalServerScaling" value="false" />
    <param name="ZeroBasedScale" value="true" />
    <param name="UseScreenResolution" value="false" />
    <param name="EnableDoubleClickRefresh" value="false" />
    <param name="ShowMouseTracking" value="true" />
    <param name="ShowScooter" value="true" />
    <param name="AutoScale.1" value="true" />
    <param name="Decimals.1" value="2" />
    <param name="AutoScale.2" value="true" />
    <param name="Decimals.2" value="2" />
    <param name="MinRange.3" value="0.00000" />
    <param name="MaxRange.3" value="0.40000" />
    <param name="Decimals.3" value="2" />
    </applet>
    I went one step further to see if I could get the scooter values shown in the legend.  I modified the query to use the StartDate & EndDate placeholders like so:
    SELECT [TIMESTAMP],[ACTUAL_FURNACE_CURRENT],[ACTUAL_FURNACE_VOLTAGE],[RAM_VELOCITY] FROM [PRODUCT_HEADER] INNER JOIN [PRODUCT_AUDIT_DATA] ON ([PRODUCT_HEADER].[PRODUCT_KEY] = [PRODUCT_AUDIT_DATA].[PRODUCT_KEY]) WHERE [PRODUCT_HEADER].[PRODUCT_KEY] = '525cb615-1b15-4b07-aa7c-9f1df9c47ba3' AND [TIMESTAMP] >= [SD] AND [TIMESTAMP] <= [ED] ORDER BY [TIMESTAMP] ASC
    I also added my initial StartDate & EndDate parameters:
    <param name="StartDate" value="02/27/2008 03:21:22" />
    <param name="EndDate" value="02/27/2008 15:14:34" />
    NOW the scooter values are shown in the legend, which is great, but all of a sudden the zoom is broken.  When I select an area to zoom and then click the zoom button, it zooms to a completely different area of the chart.  This is worse than my original problem.
    Can someone please help me out with this?  I have a feeling I'm leaving out something simple, but I can't find it.
    By the way, my display template and query template used in this example are empty so that I could show all parameters to you.
    Thanks,
    Bryan

    I removed scaling and accuracy parameters.  I also removed some parameters that controlled styling.  I added global auto scaling. 
    Now X & Y are updating properly on zoom.  Although unzoom isn't working for start date and end date.  They stay at the zoomed date.  The post data also shows the zoomed dates being sent to the server after unzoom.  The Y range updates properly on unzoom.
    Here is my updated applet html:
    <applet name="ProcessDataApplet" height="421" width="1259" code="iChart" archive="illum8.zip" codebase="/Illuminator/Classes" "mayscript="true">
    <param name="Mode" value="FixedQuery" />
    <param name="InitialUpdate" value="true" />
    <param name="QueryTemplate" value="Allvac/AMP/QueryTemplate" />
    <param name="DisplayTemplate" value="Allvac/AMP/DisplayTemplate" />
    <param name="Server" value="MONROE_VAR_ARMS" />
    <param name="Query" value="SELECT [TIMESTAMP],[ACTUAL_FURNACE_CURRENT],[ACTUAL_FURNACE_VOLTAGE],[RAM_VELOCITY] FROM [PRODUCT_HEADER] INNER JOIN [PRODUCT_AUDIT_DATA] ON ([PRODUCT_HEADER].[PRODUCT_KEY] = [PRODUCT_AUDIT_DATA].[PRODUCT_KEY]) WHERE [PRODUCT_HEADER].[PRODUCT_KEY] = '525cb615-1b15-4b07-aa7c-9f1df9c47ba3' AND [TIMESTAMP] >= [SD] AND [TIMESTAMP] <= [ED] ORDER BY [TIMESTAMP] ASC" />
    <param name="RowCount" value="10000" />
    <param name="StartDate" value="02/27/2008 03:21:22" />
    <param name="EndDate" value="02/27/2008 15:14:34" />
    <param name="ChartType" value="Line" />
    <param name="GlobalAutoScale" value="true" />
    <param name="UseScreenResolution" value="false" />
    <param name="ShowMouseTracking" value="true" />
    <param name="ShowScooter" value="true" />
    <PARAM NAME="Trace" VALUE="true">
    </applet>
    This problem isn't making any sense to me.  The documentation makes it sound like showing the current values in the legend is as easy as setting ShowScooter = true.  This wasn't the case for me though.  I had to use the [SD] and [ED] placeholders in my fixed query before the values would show up in the legend.  But then zooming breaks.  It looks like we're heading in the right direction to get the zooming fixed, but at the cost of being able to scale each pen.
    The first thing you said to me in your first post was that I'm using a 3+ years old version of xMII.  Are you saying there is a good chance this is a bug?  I was pretty convinced from the beginning that this problem is a bug.  The customer I am working for set me up with an xMII 11.5.1 server because that is what they are using in production.  Is there an online document with a list of bug fixes between versions?  If this is a known bug in 11.5.1 then maybe I can get the go ahead to upgrade.

  • Read Query String Parameter Value in SSRS

    Hi,
    We have Project Server 2010 and Sharepoint Server 2010 env and using SSRS 2008 R2 for reporting purpose in Native mode.
    Here I am displaying the SSRS Project report in Project Server page using Report Viewer web part like below.
    Here I want to read projuid query string parameter value (Highlighthed above in URL ) in SSRS by using any way, so that I can pass that
    projuid value in my SSRS report parameter to filter and make this report dynamic.
    Right now I have to select the ProjectName (Label) which passes ProjUID
    as value from the Parameter, but I want it should read the projuid
    from URL so that this reports will display the project the data for the opened Project automatically
    Thanks and let me know in case we can achive this using OOTB or some custom functions.

    Hi,
    For the report parameter, you can get the value from database query or some embedded funcitons etc. or even some customerized function.
    You may consider to create your own code for the report to read the projuid from application or URL. The customer code can be used to get the values from the applicaiton or from the url etc. Then report can call the customer code function to get the value.
    refer link
    https://technet.microsoft.com/en-us/library/ms155798(v=SQL.100).aspx
    https://support.microsoft.com/kb/920769?wa=wsignin1.0
    Thanks,

  • Unable to find Searchable Item in Query Criteria Map

    Hi ,
    Am try to personalize Advacned Search Region to Include new search Criteria in R12 iSupplier Portal->Home->Orders Tab->Advanced search.
    Am trying to create new search field in the Add another row field through personalization.
    I have created new row criteria,when am trying to create Query Criteria Map,Am unable to list the Searchable Item as it is Drop down list.
    This causing unable to query the records based on the newly created row criteria item.
    Please advise.
    Thansk<Sarath.

    Hi Jobnish,
    There is no code in this requirement.
    There is no error...Issue is unable to query data based on newly create criteria row in Advanced search.
    I can give you navigation:
    iSupplier Portal->Home->Orders Tab->Press advanced search Region
    Click on the Personalize Page(I hope you know how to enable the personalize link using profile option).
    In SupplierRN ->Advanced Search Criteria and creating custom item Criteria Row..
    We need to map this field in Advanced Query Mapping.
    However the issue is the Am unbale find the Searchable item (which is created in Criteria Row) in the drop downlist.
    I can provide screen-shot if you need.
    Thanks,Sarath.

  • Mapping Values to Data Type Enhancements in XI

    I want to a map values from a source XML to a target XML but the target fields are data type enhancements and not that of the standard one. The target message is the message of a predilevered interface of SAP for the SNC product. We did some enhancements to a particular data type. The enhancement was done in a different SCV and points to the datatype in a different SCV. Now, the mapping is in another different SCV (since the SCV for the SNC content of XI cannot be edited). When I was trying to map the values to the data type enhancement in the message mapping, the enhanced/additional fields are not there.
    How would I be able to map the values to the additional fields? Thanks in advance!

    check this:
    http://help.sap.com/saphelp_nw70/helpdata/en/a8/bfc6373c8fea43bdb3541535bcbd43/content.htm
    The Integration Builder does not recognize changes to software component versions that have already been imported. Therefore, if you want to define dependencies between imported software component versions at a later date, you have to import the superordinate software component versions into the Integration Builder again. You will not lose objects that have already been created.
    Not sure but this might help.
    Thanks,
    Beena.

  • Mapping Value Objects to Java Classes

    Hi All,
    I have one Java Class:
    public class MyBean {
        private ArrayList numbers;
    I have created one mapping value object for the same in Flex:
    package vo
        import mx.collections.ArrayCollection;
        [RemoteClass(alias="com.tcs.example.MyBean")]
        public class MyBean
            public function MyBean()
            public var numbers:ArrayCollection;
    but when I fetch the object using Remote Object, the returned object has "numbers" as null even though I'm returning from Java a filled ArrayList.
    Does any one know Why is it happening and what should I do for this.
    Thanks in advance

    Do you have getNumbers and setNumbers methods on your java bean?
    Try to activate the logs on blazeDS to see what's going on.

  • Is it possible to apply conditional formatting to a cell (or range) based upon a LOOKUP query to cell values in another sheet.? I want to alter the formatting (i.e., text and/or cell background color), but not cell content.

    Is it possible to apply conditional formatting to a cell (or range) based upon a LOOKUP query to cell values in another sheet.?
    I want to alter the formatting (i.e., text and/or cell background color), but not the content, of the target cell(s).

    Hi Tom,
    Your LOOKUP formula will return a value that it finds in the "other" table. That value can be used in conditional highlighting rules. (Numbers 3 calls it conditional highlighting, not conditional formatting. Just to keep us awake, I guess, but it works the same).
    Please explain what you are trying to do.
    Regards,
    Ian.

Maybe you are looking for