IN Operator in a Conditional Expression

I have a GenericDao, wherein I'm trying to add the following method:
public List<T> findAllByInExpression(String prop1, Object val1, String prop2, Object[] val2)
     Query query = entityManager.createQuery("select x from "
                                             + getEntityName()
                                             + " x where x."
                                             + prop1 + " = ?1 and "
                                             + prop2 + " IN ('BUSAD', 'OTHAD')");
     query.setParameter(1, val1);
//     query.setParameter(2, val2);
     return (List<T>) query.getResultList();
}Basically the prop1 goes after the id and the prop2 goes after a list of address types. For test purposes, I've temporarily hard-coded in the values. But, it's still not working. I've researched this in the JPQL resources and it "seems" I'm doing this right, but it's not flying.
Any help would be appreciated.
Thanks,
R. Grimes

Ah! Stupid me. Left off a "x.". Should be:
Query query = entityManager.createQuery("select x from "
                                        + getEntityName()
                                        + " x where x."
                                        + prop1 + " = ?1 and x."
                                        + prop2 + " IN ('BUSAD', 'OTHAD')");

Similar Messages

  • SUMIF using OR in the conditional expression

    I understand how to use the SUMIF function using checkboxes in one column for the conditional expression. I do not understand how to use it if I want to use an OR expression to OR various string values.
    I want have a column called "Categories" which have a variety of string values in them like "Club" "Soccer" "School" "Church" "Home". I want to SUMIF the category is "School" or "Home". I wrote out my formula like this:
    =SUMIF(Invitations::Category,OR("School","Home"), Invitations::Total in Party)
    but it doesn't work. Suggestions? Thank!

    Hello
    The OR is the correct operator but, as far as I know, this kind of condition is not allowed.
    Only a single one like "=Home" or like "=church" is allowed.
    I don't know which are the other categories.
    Assuming that they are "smaller than the string "church" you may use:
    =SUMIF(Category,">=church",Total in Party)
    If they are greater than "Home" you may use:
    =SUMIF(Category,"<Home",Total in Party)
    If you want to sum the values whose category matches one of three values, an alternate soluce may be to use an extraneus column (named Aux) whose formula would be
    =OR(Category="church",Category="Home",Category="YK")
    the final formula would be:
    =SUMIF(Aux,TRUE,Total in Party)
    Yvan KOENIG (from FRANCE mercredi 16 janvier 2008 14:08:41)

  • Conditional Expressions and the note about state-field's serialized form

    There's a note about state-field's serialized form in 4.6 Conditional expression chapter. Could anyone help me understanding it? It's on the page 88.
    State-fields that are mapped in serialized form or as lobs may not be portably used in conditional expressions[26].
    What's the serialized form? I think I understand what lobs might mean, but some additional explanation or a code snippet would be greatly appreciated.
    Jacek
    Jacek Laskowski
    http://www.JacekLaskowski.pl

    But that's my point. In the original expression the ++k and --k are evaluated first so the whole thing goes down as you described.  I agree completely.  But in the second case the term k is a urnary operator which would have higher precedence than the + or --- operators and therefore would be evaluated first while k is still equal to 1. Then again maybe I'm confused !
    Maybe I'll just compile the program and see what I get...

  • Why does my conditional expression not work?

    I want to increment a global keeping track of how many critcal tests have been run. Usually I just increment it in the post expression of the test. However, if I have a test that loops it would increment on every loop, so I put a conditional expression in the post expression so it only counts once the loop is done:
    RunState.LoopIndex < 10 && RunState.LoopNumPassed < 3 ? FileGlobals.Critical_Test_Count : FileGlobals.Critical_Test_Count++
    However, the false condition in the expression never gets evaluated. I've put watches in to make sure the condition goes false after the last interation of the test and it does. But my global never increments. The true condition is not supposed to modify the variable.
    What am I miss
    ing?

    The reason for this is that the post expression is evaluated before the loop increment expression, so on your last loop the post expression is evaluated (loop count = 9) then the loop increment is evaluated and the loop is terminated. See page 6-26 of the Teststand user manual.
    Hope this helps,
    Nick

  • How to populate an EO Transient variable used in Conditional expression.

    Hi All
    I have a Unique Key Validator which has Conditional Execution in which I am checking for the value of transient variable and based on that value this validator is invoked.
    Problem is :- When this Conditional expression is processed, transient variable is not populated (code to populate it is written in getter method). As a result of which, I am not getting expected results.
    This is my conditional expression :- source.<Transient_variable> = <some value>
    I tried by replacing this expression as :- adf.object.getterMethod = <some value> , but that gave me the prototype not found error (method is present in EOImpl.java).
    How can I populate this transient variable before it is evaluated in conditional expression???
    Suggestions are welcomed!!!
    Thanks
    Nitin

    Just to explain
    Both adf.object.methodName and source.methodName are used to access EntityImpl methods. Difference is
    adf.object.methodName - used while defaulting the values of attributes
    source.methodName - used in validation expression and raising error messages/warning.
    Thanks
    Nitin

  • [svn:fx-trunk] 11530: Fix ASC-3790 ( conditional expression in for loop causes verifier error) r=jodyer

    Revision: 11530
    Author:   [email protected]
    Date:     2009-11-06 13:23:05 -0800 (Fri, 06 Nov 2009)
    Log Message:
    Fix ASC-3790 (conditional expression in for loop causes verifier error) r=jodyer
    Ticket Links:
        http://bugs.adobe.com/jira/browse/ASC-3790
    Modified Paths:
        flex/sdk/trunk/modules/asc/src/java/macromedia/asc/parser/ConditionalExpressionNode.java

  • Purging FM files of conditional expressions

    As you've probably all seen, Framemaker 8 caches every (or at least the most recent few) conditional expression you create for a book. These expressions populate a dropdown list in the show/hide conditionals dialog box and just generally take up space and confuse people. I'd like to get rid of them- I know that they are stored at the very end of the chapter .FM files and book file, but I was hoping someone would know an easier way to get rid of them than opening each .FM file in notepad and scooping them out.
    Thanks!

    You might want to have a look at ElectroPubs CleanImport utility (http://www.electropubs.com/ez_cleanimport3.html ). This will purge all specified components prior to importing new ones from a template.
    Caveat: With conditional text, any conditonally tagged text that is hidden when a tag is deleted, will get wiped from the document. So you have to make certain that all tags are showing prior to import.

  • Data Change Condition Expression

    I need to create a product specification that includes dependencies between order components based on a data change notification wait condition
    How do I define the XQuery expression in the "Data Change Condition Expression" field?
    Specifically, I have 4 order components in the product specification that are independent of each other but each order component can only start when a specific data element has a certain value. The data element is at the order level and is not available as an order line item property.
    I would appreciate if someone from Oracle can provide a more detailed explanation of the fields in the "Product Specification Editor Dependencies Subtab" ->"Wait Condition subtab"
    Relative Path
    Data Change Condition Expression
    Thanks,
    ~nagu.
    Edited by: nagu on Dec 2, 2011 5:50 PM

    Provide two pieces of information:
    1. Order Item Property
    2. Boolean XQuery expression returning fn:true() to fire the dependency.
    For example:
    Assume you need to ensure all Provisioining items (From) must have reached the "PRODUCT STARTED" milestone , before the Billing Component Items (To) can start.
    Note From Component is also known as "blocking" while the To Component is known as "Waiter"
    1. Data Change Notification property: milestone
    2. Data Change Condition Expression Xquery:
    declare variable $blockingIndexes as xs:integer* external; (: list of From component items - index :)
    let $expectedMilestoneCode := "PROVISION STARTED"
    (: extract milestones values from all provisioning function items matching the expected milestone value , only for the given From component :)
    let $milestoneValues := /GetOrder.Response/_root/ControlData/Functions/ProvisioningFunction/orderItem/orderItemRef[fn:index-of($blockingIndexes, xs:integer(@referencedIndex)) != 0]/milestone[text() eq $expectedMilestoneCode]
    (: Return true only if ALL the milestones in the From component (ProvisioningFunction/orderItem/orderItemRef) are PROVISION STARTED :)
    return fn:count($milestoneValues) eq fn:count($blockingIndexes)
    Carlos

  • Boolean Condition Expressions

    Unlike Condition Formats, Paragraphs, etc., Boolean Condition Expressions are apparently not stored in a linked list. In ExtendScript, you can get a list of the Expression names with this:
    var doc = app.ActiveDoc;
    var exprCat = doc.GetBuildExprCatalog();
    This gives you an array of strings containing the Expression names. I am not sure what the FrameScript or FDK equivalents are, but I assume there is a way to do this.
    Once you have the list, you can get each definition by doing this:
    for (var i = 0; i < exprCat.length; i += 1) {
        var expr = doc.GetBuildExpr (exprCat[i]);
        Console ("Name: " + exprCat[i] + " Definition: " + expr);
    I hope this will helpful to someone in the future. Please let me know if you have any questions or comments. Thank you very much.
    Rick

    Hello,
    You can better use the condition Exists (SQL Query returns at least one row)
    In expression 1 you would put : select GROUP from pl_department where userid = :APP_USER;
    The problem you are facing is that your code is going into exception. If you really want to keep your code you can adapt it like:
    DECLARE
    t1 varchar2(20);
    BEGIN
    select GROUP into t1 from pl_department where userid = :APP_USER;
    if ((t1 = '-') OR (t1 is null) OR (t1 = '') or (t1 = '%' || 'null%')) then
    return false;
    else
    return true;
    end if;
    EXCEPTION WHEN NO_DATA_FOUND THEN return false;
    END;
    But I would recommend my first suggestion.
    Regards,
    Dimitri
    http://dgielis.blogspot.com/
    http://www.apex-evangelists.com/
    http://www.apexblogs.info/
    REWARDS: Please remember to mark helpful or correct posts on the forum

  • How to represent conditional expressions as data in an xml

    Hi All,
    Re phrasing my earlier question,
    1. How can I represent conditional expressions as data in an xml doc.
    2. How do I query these conditional expressions using xPath functions.
    Any pointers towards achieving this?
    Regards,
    Nishanth
    Edited by: user10947302 on Apr 16, 2009 4:18 PM
    Edited by: user10947302 on Apr 16, 2009 4:22 PM

    Nishanth,
    just for your understanding. I only understand your question a little bit because you left information bits all over the OTN forum sections. First off all, these forums are based on people that (most of the time) are not paid for what they doing here. Its all free will and takes effort. So be so curtious to me as specific as possible PLUS don't spam all the forum posts in the hope that someone will provide the answer.
    This forum is mend for XMLDB questions. The functionality that supports XML handling in the Oracle database.
    --> OR you have a question for this forum
    --> OR you have to ask your question on the "Rules Manager & Expression Filter" forum
    last time someone shattered the same question all over the place, the only thing it triggered with me was looking up the following Monty Python scetch about spam (and then I went to bed): http://www.youtube.com/watch?v=anwy2MPT5RE

  • Mifwash loses names of boolean conditional expression

    (FM10 on Win7x64)
    Before a mifwash, boolean expressions for conditional tags are named as: Name1, Name2, Name3.
    After the mifwash, those expressions are named Default Expression, Default Expression1 and Default Expression2.
    A quick check of the mif file shows Name1, Name2, Name3, not Default Expression, Default Expression1 or , Default Expression2.
    What am I missing?

    More detail:  the mif contains the correct names of the conditional expressions: Name1, Name2 and Name3.
    And the mif does not contain Default Expression, Default Expression1 or Default Expression2.
    Doh!
    Edit:  FM11 behaves as expected. The names of the boolean expressions in the MIF appear in the GUI and "Default Expression" does not appear.
    Now I gotta considering upgrading to FM11.

  • Using the variable ? operator in an XPath Expression

    I'm trying to using the variable operator (?) in an Oracle prepared statement used in a query where clause. Here is the query:
    select xt.APPLICATION_NAME, xt.VERSION, xt.EVENT_TYPE, xt.SENDING_SITE, xt.RECEIVING_SITE, xt.EVENT_ID
          from AUDITED_EVENT_XML_MIN e,
             XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
                    '/xae:auditable-event'
                    PASSING e.xml_event_content
                    COLUMNS
                    APPLICATION_NAME VARCHAR2(255) PATH 'xae:application-name',
                    VERSION          VARCHAR2(255) PATH 'xae:version',
                    EVENT_TYPE       VARCHAR2(255) PATH 'xae:event-type',
                    SENDING_SITE     VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.4/HD.2',
                    RECEIVING_SITE   VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.6/HD.2',
                    EVENT_ID         VARCHAR2(255) PATH 'xae:xml-event-content/*/MSH/MSH.10') xt
                where existsNode(E.XML_EVENT_CONTENT, '/xae:auditable-event[xae:event-type=?]','xmlns:xae="http://gov/va/med/datasharing/audit/endpoint/audit"') = 1This code works when the ? is replaced with "aValue". I need to use the ? so that my Java client can pass a variable value into the query.
    Is this a supportable feature or am I doing something wrong?
    I didn't see any examples in the Oracle XML DB Developers Guide where there was a ? in an XPath expression.
    I also tried "?" with the same issue...
    Here is the version info:
    SQL*Plus: Release 11.1.0.6.0 - Production on Mon Sep 10 18:41:55 2012
    Copyright (c) 1982, 2007, Oracle.  All rights reserved.
    Connected to:
    Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
    With the Partitioning, OLAP, Data Mining and Real Application Testing optionsAny assistance would be greatly appreciated.
    Thanks in advance...

    I incorporated this suggestion and it worked very well. Thanks!
    Now I have converted my solution to use a structured index. As such, I want to write the where clauses in terms of column names rather than XPath expressions.
    I hoped it was as simple as changing the code that generates the XPath expression to generate a SQL expression. After making that change, I'm now getting this error:
    Caused by: java.sql.SQLSyntaxErrorException: ORA-00920: invalid relational operator
         at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:91)
         at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
         at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
         at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:686)
         at oracle.jdbc.driver.T2CConnection.checkError(T2CConnection.java:617)
         at oracle.jdbc.driver.T2CPreparedStatement.executeForDescribe(T2CPreparedStatement.java:559)
         at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1077)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1186)
         at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3381)
         at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3425)
         at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1490)
         at gov.va.med.datasharing.audit.dao.jdbc.runner.MapQueryRunner.run(MapQueryRunner.java:47)
         at gov.va.med.datasharing.audit.web.dao.jdbc.AuditableEventsQueryDAOImpl.getAuditableEventsByDate(AuditableEventsQueryDAOImpl.java:150)It seemed to me that if it worked for the XPath expression that it should also work for the SQL expression.
    The static SQL is:
    SELECT PK_ID, EVENT_TYPE, OUTCOME, SENDING_SITE, RECEIVING_SITE, CREATED_TIME, EVENT_ID, PATIENT_ID FROM
      (SELECT rownum as rn, PK_ID, EVENT_TYPE, OUTCOME, SENDING_SITE, RECEIVING_SITE, CREATED_TIME, EVENT_ID, PATIENT_ID FROM
         (SELECT aet.AUDITABLE_EVENT_XML_PK_ID AS PK_ID, xt.EVENT_TYPE, xt.OUTCOME, xt.SENDING_SITE, xt.RECEIVING_SITE, aet.CREATED_TIME as CREATED_TIME, xt.EVENT_ID, xt.PATIENT_ID
            FROM AUDITABLE_EVENT_XML aet,
              XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
                '/xae:auditable-event'
                PASSING aet.xml_event_content
                COLUMNS
                EVENT_TYPE       VARCHAR2(255) PATH 'xae:event-type',
                SENDING_SITE     VARCHAR2(255) PATH 'xae:sending-site',
                RECEIVING_SITE   VARCHAR2(255) PATH 'xae:receiving-site',
                EVENT_ID         VARCHAR2(255) PATH 'xae:event-id',
                PATIENT_ID           VARCHAR2(255) PATH 'xae:patient-id',
                OUTCOME                VARCHAR2(255) PATH 'xae:outcome') xt
            WHERE aet.CREATED_TIME BETWEEN ? AND ?
                 AND ?
          ) ORDER BY CREATED_TIME desc
        ) WHERE rn &gt; ? and rn &lt;= ?So I'm thinking that Oracle must perform strong checking in SQL, not allowing the '=' operator to be substituted. If I run this query in Toad, replacing the ? with the SQL, it runs fine...
    Can someone tell me whether or not this is a legal substitution?
    The SQL that runs in Toad is:
    SELECT PK_ID, EVENT_TYPE, OUTCOME, SENDING_SITE, RECEIVING_SITE, CREATED_TIME, EVENT_ID, PATIENT_ID FROM
      (SELECT rownum as rn, PK_ID, EVENT_TYPE, OUTCOME, SENDING_SITE, RECEIVING_SITE, CREATED_TIME, EVENT_ID, PATIENT_ID FROM
         (SELECT aet.AUDITABLE_EVENT_XML_PK_ID AS PK_ID, xt.EVENT_TYPE, xt.OUTCOME, xt.SENDING_SITE, xt.RECEIVING_SITE, aet.CREATED_TIME as CREATED_TIME, xt.EVENT_ID, xt.PATIENT_ID
            FROM AUDITABLE_EVENT_XML aet,
              XMLTable(XMLNAMESPACES('http://gov/va/med/datasharing/audit/endpoint/audit' AS "xae"),
                '/xae:auditable-event'
                PASSING aet.xml_event_content
                COLUMNS
                EVENT_TYPE       VARCHAR2(255) PATH 'xae:event-type',
                SENDING_SITE     VARCHAR2(255) PATH 'xae:sending-site',
                RECEIVING_SITE   VARCHAR2(255) PATH 'xae:receiving-site',
                EVENT_ID         VARCHAR2(255) PATH 'xae:event-id',
                PATIENT_ID         VARCHAR2(255) PATH 'xae:patient-id',
                OUTCOME             VARCHAR2(255) PATH 'xae:outcome') xt
            WHERE aet.CREATED_TIME BETWEEN TO_DATE ('9/19/2011 12:00:01 AM','MM/DD/YYYY HH:MI:SS PM')
                                         AND TO_DATE ('12/20/2012 12:00:00 AM','MM/DD/YYYY HH:MI:SS PM')
                AND (OUTCOME=0 or OUTCOME=1)
          ) ORDER BY CREATED_TIME desc
        ) WHERE rn > 0 and rn <= 5;Any assistance will be appreciated,
    Thanks in advance.

  • How to change operator of join conditions in where clause?

    Hello
    I have a situation... I want to change the operator between each join conditions in the where clause when these join conditions are not from the same join..
    For example, I have the following schema:
    Dim1 ------ DimA -------Fact1
    Dim1-------DimB -----Fact1
    So DimA and DimB are aliasas of one dim table, but the join is different.
    Now if I run this model, what I will get in the where clause of the query is:
    Where Dim1 = DimA and Dim1 = DimB and DimA= Fact1 and DimB = fact1.
    Is there a way I can change these "and" operator to "OR", so that the where clause would look like this: Where Dim1 = DimA and Dim1 = DimB and DimA= Fact1 OR DimB = fact1?
    This is different from simply changing the join operator within the same join, because these are different joins and I'd like to control how they relate to each other..
    Please help
    Thanks

    Sometimes, business rules are complex, so there isn't always a way to simplify things.  Is your issue that it's complex and error prone, or is it performance due to the OR clauses?
    One possibility that will at least make it easier to test and debug is something like this:  (pseudocode)
    From Table1 Inner join Table2 on x=y etc.etc.
    CROSS APPLY
    (Select case when a=b and (c=d or e=f) then 1 else 0 end) as Situation1
    , case when h=i or j = k then 1 else 0 end) as situation2
    , case when l = m then 1 else 0 end) as situation 3
    ) as CA_Logic_Simplifier
    Where situation1 = 1 and situation2 = 1 and situation3 = 1
    Although you could say, "Hey, this is basically doing the same thing as before", this approach would be far easier to test and debug, because you can at a glance look at the values for situation1, 2, 3, etc. to see where errors are being introduced. 
    The cross apply makes the columns situation1/2/3 "instantiated", so they are usable in the where clause. Divide and conquer.  

  • How to use relational operator(NE) and aggregate expression sequentially

    Hi,
    I am trying to use "WHERE BEDAT NE MAX( BEDAT )" to find out PO date that is not the MAX Date but it always shows "incorrect expression "MAX(" in logical condition. Please give solution
    Thanks
    Arif

    Hi Arif,
    please try using a subquery:
    select *
      from ekko
      where bedat ne
        select max( bedat )
          from ekko
    endselect.
    I hope this helps. Kind regards,
    Alvaro

  • CcBPM check condition expression

    Hi,
         For a xml response say "
    <header>
      <part1/>
       <part2/>
    </header>
    How do i provide the condtion expresion  in ccBPM via Xpath (or any other way( to see if part2 tag is absent?
    Regards,
    Premjit

    Hi Premjit,
    Using the condition editor just query the existence of this node element (by using the existence operator (EX)).
    Regards,
    ---Satish

Maybe you are looking for

  • How to Install Visual Studio 2010 on a PC with Microsoft Office 2013 with 64 bits

    I am with problems to have acess to the link: http://www.microsoft.com/en-us/download/details.aspx?id=12187 Why? I want do install Visual Studio 2010 on a PC with Microsoft Office 2013 with 64 bits. How can I do it? Thanks.

  • Acrobat 9 Security issue

    I'm setting up Password Security for editing and printing my PDF which works fine -- But each time I set my compatibility to "Acrobat 6.0 and later" in the Password Security- Settings window, and as soon as I save and reopen the PDF it defaults to "P

  • Quicktime in iweb page won't play in safari, but does play in firefox

    Some people (but not all) report problems going to this webpage http://web.me.com/michael_grenadier/Loudon/TheCharliePooleProject.html The quicktime doesn't play, just a quicktime icon. I just checked it on my macbookpro and that's what happens, but

  • Jdeveloper 9.0.3 support for a standard WAR / package issues

    We are being pitched on how wonderful the JDeveloper IDE is and how our days will be enlightened by it (the same folks that sold our company on o-apps 11i)... so I've been tryin' it out only to hit a MAJOR roadblock. Basically, we need CVS developmen

  • Java displays not being redirected to the DISPLAY environment variable

    I am running Solaris 8 and am using java se 1.4.1. I have a java application that is running in the background on BOX 1. It needs to use the JOptionPane.showmessage() function. When I remote onto Box 1 from Box 2, and run the java application, the me