XPath Query Language Reference

Aside from the three little examples given in the 11g Guide and the B2B Tech Note #011, is there a reference available for the XPath Query Language used by B2B? Is is possible to use complex XPath queries in the B2B Doc Definitions?

I'm mainly just looking for the full capabilities of the queries.
Specifically, at the moment, I'm looking for a way to match the value of a node to a group of values (like a sql 'in') as well as check the existence and value of other nodes within the same query.
Do the documents I find for 'Preference XPath' pertain here?

Similar Messages

  • Copying Variables in BPEL using XPath Query

    Hi,
    I am new to BPEL and i want to know if it is possible to copy data from one variable to another using XPath Query in the <from> <to> tags, when the two variables are of different message types.
    I am trying to create a sample BPEL that would receive a String through the receive tag tied to one partner link (WSDl) and then invoke a different webservice using the <invoke> tag tied to another partner link (WSDL) by passing the received variable.
    I have pasted the BPEL File and the two WSDl files involved.
    My Issue is that when I send a soap request to the BPEL, it is passed as null to the webservice invoked.
    Probably because the copy tags don't work.
    Please help.
    BPEL File
    <!--
    ~ Licensed to the Apache Software Foundation (ASF) under one
    ~ or more contributor license agreements. See the NOTICE file
    ~ distributed with this work for additional information
    ~ regarding copyright ownership. The ASF licenses this file
    ~ to you under the Apache License, Version 2.0 (the
    ~ "License"); you may not use this file except in compliance
    ~ with the License. You may obtain a copy of the License at
    ~
    ~ http://www.apache.org/licenses/LICENSE-2.0
    ~
    ~ Unless required by applicable law or agreed to in writing,
    ~ software distributed under the License is distributed on an
    ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    ~ KIND, either express or implied. See the License for the
    ~ specific language governing permissions and limitations
    ~ under the License.
    -->
    <process name="HelloWorld2"
    targetNamespace="http://ode/bpel/unit-test"
    xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
    xmlns:tns="http://ode/bpel/unit-test"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:test="http://ode/bpel/unit-test.wsdl"
    xmlns:ns0="http://poc.com"
    queryLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0"
    expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath2.0">
    <import location="HelloWorld2.wsdl"
    namespace="http://ode/bpel/unit-test.wsdl"
    importType="http://schemas.xmlsoap.org/wsdl/" />
    <import location="sayHello.wsdl"
    namespace="http://poc.com"
    importType="http://schemas.xmlsoap.org/wsdl/" />
    <partnerLinks>
    <partnerLink name="helloPartnerLink"
    partnerLinkType="test:HelloPartnerLinkType"
    myRole="me" />
    <partnerLink name="sayHelloBPELPL"
    partnerLinkType="ns0:sayHelloPLT"
    partnerRole="you" initializePartnerRole="yes" />
    </partnerLinks>
    <variables>
    <variable name="myVar" messageType="test:HelloMessage"/>
    <variable name="tmpVar" messageType="test:HelloMessage"/>
    <variable name="inVar" messageType="ns0:sayHelloRequest"/>
    <variable name="outVar" messageType="ns0:sayHelloResponse"/>
    </variables>
    <sequence>
    <receive
    name="start"
    partnerLink="helloPartnerLink"
    portType="test:HelloPortType"
    operation="hello"
    variable="myVar"
    createInstance="yes"/>
    <assign name="ass1">
    <copy>
    <from variable = "myVar" part = "TestPart"/>
    <to variable = "inVar"
    part = "parameters"
    query= "/sayHello/ns0:param0" />
    </copy>
    </assign>
    <invoke partnerLink = "sayHelloBPELPL"
    portType = "ns0:sayHelloPortType"
    inputVariable = "inVar"
    operation = "sayHello"
    outputVariable = "outVar">
    </invoke>
    <assign name="ass2">
    <copy>
    <from variable = "outVar"
    part = "parameters"
    query= "/sayHelloResponse/ns0:return" />
    <to variable = "tmpVar" part="TestPart"/>
    </copy>
    </assign>
    <reply name="end"
    partnerLink="helloPartnerLink"
    portType="test:HelloPortType"
    operation="hello"
    variable="tmpVar"/>
    </sequence>
    </process>
    WSDL File1
    <?xml version="1.0" encoding="utf-8" ?>
    <!--
    ~ Licensed to the Apache Software Foundation (ASF) under one
    ~ or more contributor license agreements. See the NOTICE file
    ~ distributed with this work for additional information
    ~ regarding copyright ownership. The ASF licenses this file
    ~ to you under the Apache License, Version 2.0 (the
    ~ "License"); you may not use this file except in compliance
    ~ with the License. You may obtain a copy of the License at
    ~
    ~ http://www.apache.org/licenses/LICENSE-2.0
    ~
    ~ Unless required by applicable law or agreed to in writing,
    ~ software distributed under the License is distributed on an
    ~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
    ~ KIND, either express or implied. See the License for the
    ~ specific language governing permissions and limitations
    ~ under the License.
    -->
    <wsdl:definitions
    targetNamespace="http://ode/bpel/unit-test.wsdl"
    xmlns="http://schemas.xmlsoap.org/wsdl/"
    xmlns:tns="http://ode/bpel/unit-test.wsdl"
    xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
    xmlns:ns0="http://poc.com">
    <wsdl:message name="HelloMessage">
    <wsdl:part name="TestPart" type="xsd:string"/>
    </wsdl:message>
    <wsdl:portType name="HelloPortType">
    <wsdl:operation name="hello">
    <wsdl:input message="tns:HelloMessage" name="TestIn"/>
    <wsdl:output message="tns:HelloMessage" name="TestOut"/>
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="HelloSoapBinding" type="tns:HelloPortType">
    <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="hello">
    <soap:operation soapAction="" style="rpc"/>
    <wsdl:input>
    <soap:body
    namespace="http://ode/bpel/unit-test.wsdl"
    use="literal"/>
    </wsdl:input>
    <wsdl:output>
    <soap:body
    namespace="http://ode/bpel/unit-test.wsdl"
    use="literal"/>
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="HelloService">
    <wsdl:port name="HelloPort" binding="tns:HelloSoapBinding">
    <soap:address location="http://localhost:8082/ode/processes/helloWorld"/>
    </wsdl:port>
    </wsdl:service>
    <plnk:partnerLinkType name="HelloPartnerLinkType">
    <plnk:role name="me" portType="tns:HelloPortType"/>
    <plnk:role name="you" portType="tns:HelloPortType"/>
    </plnk:partnerLinkType>
    </wsdl:definitions>
    WSDL File 2
    <?xml version="1.0" encoding="UTF-8" ?>
    <wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
    xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
    xmlns:ns0="http://poc.com"
    xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
    xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
    xmlns:ns1="http://org.apache.axis2/xsd"
    xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
    xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
    targetNamespace="http://poc.com">
    <wsdl:types>
    <xs:schema xmlns:ns="http://poc.com" attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://poc.com">
    <xs:element name="sayHello">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" name="param0" nillable="true" type="xs:string" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    <xs:element name="sayHelloResponse">
    <xs:complexType>
    <xs:sequence>
    <xs:element minOccurs="0" name="return" nillable="true" type="xs:string" />
    </xs:sequence>
    </xs:complexType>
    </xs:element>
    </xs:schema>
    </wsdl:types>
    <wsdl:message name="sayHelloRequest">
    <wsdl:part name="parameters" element="ns0:sayHello" />
    </wsdl:message>
    <wsdl:message name="sayHelloResponse">
    <wsdl:part name="parameters" element="ns0:sayHelloResponse" />
    </wsdl:message>
    <wsdl:portType name="sayHelloPortType">
    <wsdl:operation name="sayHello">
    <wsdl:input message="ns0:sayHelloRequest" wsaw:Action="urn:sayHello" />
    <wsdl:output message="ns0:sayHelloResponse" wsaw:Action="urn:sayHelloResponse" />
    </wsdl:operation>
    </wsdl:portType>
    <wsdl:binding name="sayHelloSOAP11Binding" type="ns0:sayHelloPortType">
    <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
    <wsdl:operation name="sayHello">
    <soap:operation soapAction="urn:sayHello" style="document"/>
    <wsdl:input>
    <soap:body use="literal" />
    </wsdl:input>
    <wsdl:output>
    <soap:body use="literal" />
    </wsdl:output>
    </wsdl:operation>
    </wsdl:binding>
    <wsdl:service name="sayHello">
    <wsdl:port name="sayHelloPort" binding="ns0:sayHelloSOAP11Binding">
    <soap:address location="http://localhost:8082/ode/processes/sayHello" />
    </wsdl:port>
    </wsdl:service>
    <plnk:partnerLinkType name="sayHelloPLT">
    <plnk:role name="me" portType="ns0:sayHelloPortType"/>
    <plnk:role name="you" portType="ns0:sayHelloPortType"/>
    </plnk:partnerLinkType>
    </wsdl:definitions>

    Hi,
    Yes, it very much is possible.
    Xpath query provides a lot many data type conversion functions(string to int, string to date etc), which can be used in copying variables.
    thanks
    Saurabh

  • Correct wat to determine if the XPath Query resulted in a match

    What is the correct way to determine of the XPath Query
    (using e4x syntax) returned matching nodes?
    The result is never a null reference even if there are no
    matches found, and I can't seem to find a way to determine if the
    XMLList returned has any nodes except for a convoluted way like so:
    var matchingRecords:XMLList =
    xmlData.dataTable[0].dataRow.(@someAttribute == someVariable);
    var record:XML = matchingRecords[0]; //This is the part I
    don't like to have to do.
    if (record == null)
    //This means no matches were found.
    else
    //This means atleast one match was found.

    "...they feel they've done it all too perfectly ..."
    I've been working with Flex since it was beta, and I must
    disagree with this. In my experience, the Adobe/MM folks are paying
    very close attention to what we say.
    You need to understand that you do not modify/release
    commercial software casually. It will take months to years. Be
    patient, or find a workaround, they exist.
    Be sure to log your wishes/bugs on the wishform. I know for a
    fact that they monitor that. I have been contacted for
    clarifications on my posts there.
    http://www.macromedia.com/support/email/wishform/
    Tracy

  • XPath Query

    Hi All,
    How to use Xpath query . I need a example of Xpath query activity in CPO.

    XPATH query is a pretty standard XML/web query language. You can review it in general @ http://www.w3schools.com/xpath/xpath_syntax.asp
    For CPO examples, I suggest you go check out the design center and/or my blog (which is public to all).
    The blog is called Pondering Automation and is @ https://supportforums.cisco.com/community/5811/intelligent-automation
    I do a ton of web service work with JSON, XML, Xpath queries , etc.
    Also here if you are more specific with your use-case about what you are doing it might be more easy for us to help and everyone to benefit from it.

  • Applying a query language to collections

    Hi, we handed in a project a while ago that was essentially to read in data from a .DAT file, store it in appropriate collections, then use a basic query language to filter through the stored data. I wasn't really happy with my querying though, as it was basically a huge succession of control statements. The queries were of the form "select OBJECTNAME where ATRIBUTE OPERATOR VALUE and ATRIBUTE OPERATOR VALUE", there could be as many sub clauses as desired (0... 200 whatever). For example "select elephant where height > 360 and weight <= 1000".
    We had a comment back that we should use a Query interface and a two subclasses to represent a simple query (e.g. height > 360) and then a conjunctive query (ie simplequery1 AND simplequery2 ). The Query interface would then have a match method. I'm struggling to get my head around how I do this, does anyone have a simple example or explaination that might help me out?
    Cheers.

    I've done something like this a couple times. Your need to get a better idea of what you want your query language to look like. For example, if you're given a list of elephants, the "select elephant" part is unnecessary (your query will just return a list of matching elephants). You should decide if you want it to handle things like (height > (weight / 2)), whether conditions can be nested "((a and b) or (c and d)) and (e or f)". Will you need to support the conditional operator (a ? b : c) or a unary operator (-)? How complex will your order of operations rules be?
    If you keep it simple (always two operands), you could go with something like this:
    public interface QueryOperator
      public boolean eval(Object leftParam, Object rightParam);
    public enum BasicOperators implements QueryOperator
    public class  QueryElement
      private QueryOperator operator;
      private Object leftParam;
      private Object rightParam;
    }

  • Error in PL/SQL Language Reference .... could be that possible ?

    I use Oracle 10g ....... but when I used that function in :-
    Oracle® Database
    PL/SQL Language Reference
    11g Release 1 (11.1)
    B28370-02
    September 2007
    page 252
    CREATE OR REPLACE FUNCTION compute_bonus (emp_id NUMBER, bonus NUMBER)
    RETURN NUMBER
    IS
    emp_sal NUMBER;
    BEGIN
    SELECT salary INTO emp_sal
    FROM employees
    WHERE employee_id = emp_id;
    RETURN emp_sal + bonus;
    END compute_bonus;
    The following equivalent SELECT statements invoke the PL/SQL subprogram in
    Example 8–5 using positional, named, and mixed notation:
    SELECT compute_bonus(120, 50) FROM DUAL; -- positional
    SELECT compute_bonus(bonus => 50, emp_id => 120) FROM DUAL; -- named
    SELECT compute_bonus(120, bonus => 50) FROM DUAL; -- mixed
    ====================================
    and than executed first select statement ..... it pass successfully
    but in second and third select ...... I found this errors :-
    SQL> SELECT compute_bonus(120, 50) FROM DUAL;
    COMPUTE_BONUS(120,50)
    8050
    SQL> SELECT compute_bonus(bonus => 50, emp_id => 120) FROM DUAL;
    SELECT compute_bonus(bonus => 50, emp_id => 120) FROM DUAL
    ERROR at line 1:
    ORA-00907: missing right parenthesis
    SQL> SELECT compute_bonus(120, bonus => 50) FROM DUAL;
    SELECT compute_bonus(120, bonus => 50) FROM DUAL
    ERROR at line 1:
    ORA-00907: missing right parenthesis
    is there any relation between that I use oracle 10g and those errors ???
    or the code wrote wrong in oracle reference 11g ( I hope not ) ???

    yes, you are correct. the "what's new" section of the 11g pl/sql manual states
    "Before Release 11.1, a SQL statement that invoked a PL/SQL subprogram had to specify the actual parameters in positional notation. As of Release 11.1, named and mixed notation are also allowed. This improves usability when a SQL statement invokes a PL/SQL subprogram that has many defaulted parameters, and few of the actual parameters must differ from their default values."

  • Retrieve xml attribute value of nth xml node using xpath query

    I have an xml with following stucture...
    <xml>
    <header>
     <DocumentReference OrderId="order001">
     <DocumentReference OrderId="order002">
     <DocumentReference OrderId="order003">
    I have to loop through this xml and retrieve the orderId values inside Biztalk orchestration.
    In the expression shape, I get the count of 'DocumentReference' nodes using an xpath query and then
    Added a loopshape to make sure it loops thru all nodes
    Loop condition:   n<=nodeCount     (where n is an integer variable, n=0 to begin with, incremented by 1 thru each loop, nodeCount is # of DocumentReference nodes)
     I try retrieve to the orderId in the following expression shape using the below xpath query
      xpathQuery = System.String.Format("//*[local-name()='OrderReference'][{0}]/@orderID)",n);
      sOrderId = xpath(MsgSingleInvoice,xpathQuery);
    And I get the following exception:
    Inner exception: '//*[local-name()='OrderReference'][1]/@orderID)' has an invalid token.
    Exception type: XPathException
    Appreciate any help!   thanks!

    Thanks for the quick response. I got rid of it.
    And I see a different error:
    Inner exception: Specified cast is not valid. Exception type: InvalidCastException
    Source: Microsoft.XLANGs.Engine  
    Target Site: System.Object XPathLoad(Microsoft.XLANGs.Core.Part, System.String, System.Type)
    Since variable 'n' is of integer type, I suspected it and changed it to n.ToString() and tested again and still see the same error.

  • Standalone ActionScript 3.0 Language Reference display not working

    I am unable to view the majority of the downloadable standalone ActionScript 3.0 Language Reference.
    The document in question: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/standalone.zip
    (link grabbed from http://www.adobe.com/devnet/actionscript/references.html)
    To replicate:
    1) Download the file from http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/standalone.zip.
    2) Expand the zip, open the resulting folder and open the index.html document in your web browser.
    3) Pick any filter link you desire from the choices on this page. Notice that the package and class filters in the header continuously display "Retrieving Data from Server…"
    4) Click on the Classes link in the header at the top.
    Result: The class list displays only momentarily, then completely hides.
    It would be great if there was a way to completely circumvent the filters. There appear to be several missing linked elements in the download, such as en_US/shared/ahpods/AHPod.js.
    I would gladly settle for an all-in-one PDF of the reference.

    Fix from Joe ... Ward on the http://forums.adobe.com/message/3958537#3958537 thread:
    Unzip the reference into a folder named "langref" -- there's a bug in the Javascript that filters the page content based on your selections (in those controls that say "Retrieving data from server..."). The code actually looks for a folder named "langref". (I'm sure the engineer who did that thought it was a quick hack he or she would clean up right away...)
    THANKS!

  • Variable Picker generates invalid XPath query

    This one seems to be a bug:
    When declaring a variable of type "element" (not "messageType") and accessing the variable with the Variable Picker from within the assign assistant, i.e. the following line ist generated:
    bpws:getVariableData("testVar","","/tns:TaskMgrTestCaseRequest/tns:input")
    The BPEL process can be validated and deployed without an error.
    At runtime the following exception is generated:
    XPath expression failed to execute.
    Error while processing xpath expression, the expression is "bpws:getVariableData("testVar", "", "/tns:TaskMgrTestCaseRequest/tns:input")", the reason is XPath expression failed to execute.
    Error while processing xpath expression, the expression is "", the reason is Unexpected ''.
    Please verify the xpath query.
    Please verify the xpath query.
    When working with variables of type messageType, there is no problem. (So I declared a messageType to each element type ...)
    Wolfgang

    Thanks for the heads up. We will try to kill this bug in the 0.97 release. -Edwin

  • Flex Builder language reference update

    I hope I can find some answers here. I have the following problem or wish ;-)
    After installing/configureing flex builder 3 with the new 3.5 sdk I still have old language reference files in use. Is there a way to install a new documentationt set? if yes, how and where can I get those? I've been searching for some time now, but without success.
    I know, I could download the different packages for flex, air, as3 etc, extract the asdocs and use them offline in my browser. But I'd relly like to have them included in flex builder.
    Thanks in advance
    Marcel

    Yes, I want to be able to type something simple like "CANVAS" and have the ******* (edit: didn't know a "frig" was foul language, haha) documentation for that class come up. Is that too much to ask Adobe? I don't want 500 pages of crap tutorial help pages that happen to have the word canvas in them, just show me the class interface details!
    PDF just isn't the same. I'd like to have a decent chm like the ones floating around for Java. Setting search scope doesn't help, I still seem to get crap results from a search. This should be fast and easy, type the name of the class you want details about and there it is.  Right now freaking google is probably the closest thing out there but you're still dependent on the internet which has even more off topic clutter, and you have to type "flex " beforehand--lame.  Has anyone figured out an easier way to do this moronicly simple task with minimal effort?  We shouldn't have to hit more buttons than the number of letters in the class name + ENTER.  I know, I'm picky.

  • I need to add a single field from with_item table . need to write select query with reference to company code , account doc no , fiscal year

    I need to add a single field from with_item table . need to write select query with reference to company code , account doc no , fiscal year

    Hi Arun ,
    Can you explain little bit more ??
    what is account doc no? 
    what are the transactions should be displayed in your output??
    -Rajesh N

  • What is the "Language Reference" difference between AS, Flash, and FLEX?

    I'm fairly new to the world of Flash9 / Flex2 / ActionScript3
    development environment.
    As I was reading through tutorial for FLEX/AS, I was
    introduced to Language Reference for FLEX 2.0.
    At the same time, I noticed in FLASH9 / AS3 there is also
    Language Reference page. For a moment, I thought these 2 Language
    Reference shared the same API / Language components.
    As I have found out, when I was looking up Language Reference
    for "Button" class for FLE2.0, it provided
    - mx.controls.Button
    But for Language Reference for "Button" class for FLASH9 /
    AS3, it provided different package
    - fl.controls.Butoon
    Why are there 2 sets of packages for the class Button?
    Shouldn't there just be one package for class Button?
    thanks,
    Ming

    Hello,
    The names can be confusing, especially since IE identifies Flash Player as Shockwave Flash Object in 'Manage Add-ons'.  They are, in fact, two different programs, as noted in your Programs and Features screenshot. Flash Player plays web content created using Flash Professional, Flex, or Flash Builder (ActionScript programming language).  Adobe Shockwave Player plays web content that has been created using Adobe Director.  They are not interchageable.  Web content created using ActionScript requires Flash Player and web content created with Adobe Director requires Shockwave Player.
    More info:
    Adobe Director
    Adobe Shockwave Player
    Flash Player | Adobe Flash Player | Overview
    HTH.
    Maria

  • EJB Query Language

    Hi All,
         I am using SAP Netweaver Developer Studio(2004)version.I want to know that EJB2.0 Query Language will
    support Joins,Internal select statement with in a select
    statement or not.Is it posssible or not.I have a requirement lilke this,I have to use joins.
    Thanks & Regards,
    Guru

    Guruvulu,
    In EJB QL you may operate on objects relations (both 0..1 and 0..n) in the same way as with joins in SQL. So the answer is yes.
    Read free <a href="http://www.theserverside.com/books/wiley/masteringEJB/downloads/MasteringEJB3rdEd.pdf">Mastering EJB</a> book -- it contains separate chapter on EJB QL.
    Valery Silaev
    EPAM Systems
    http://www.NetWeaverTeam.com

  • EJB Query Language where condtion based on date

    Hi,
    I am using EJB3 query language. In the table I have a column called requestdate which is in date time format. I have created an entity class.
    I need to select few records using query language(named queries) based on this requestdate matching to the current date. I want to compare only based on Date value (truncating the time). Something like this
    select max(o.req_id) from requests o where o.requestdate = :currentdate
    currentdate is java.sql.Date value formatted to yyyymmdd only.
    How can I do this using query language?
    Please help to me get this done.
    thanka
    Anuradha

    Hi Anuradha ,
    I'm afraid the query language does not support retrieving the date portion (i.e. truncating the time) from a date field.
    I propose you turn you named into a BETWEEN query taking two parameters one for the beginning of the day and another for the end of the day. Then your named query could look like:
    SELECT max(o.req_id) FROM requests o WHERE o.requestdate BETWEEN :start AND :end
    The following code creates two calendar instances for the current day, one for 00:00:00 and another for 23:59:59:
    Calendar start = Calendar.getInstance();
    start.set(Calendar.HOUR_OF_DAY, 0);
    start.set(Calendar.MINUTE, 0);
    start.set(Calendar.SECOND, 0);
    start.set(Calendar.MILLISECOND, 0);
    Calendar end = Calendar.getInstance();
    end.set(Calendar.HOUR_OF_DAY, 23);
    end.set(Calendar.MINUTE, 59);
    end.set(Calendar.SECOND, 59);
    end.set(Calendar.MILLISECOND, 999);
    Here is some sample code that creates a query instance for a named query called findMaxRequestPerDay and passes the Date of the above Calendar instance as actual parameter values. It assumes the named query is called findMaxRequestPerDay and the req_id field is a long:
    Query query = em.createNamedQuery("findMaxRequestPerDay");
    query.setParameter("start", start.getTime());
    query.setParameter("end", end.getTime());
    Long max = (Long)query.getSingleResult();
    I hope this helps.
    Regards Michael

  • EJB query language help!!

    Hi all, I have been trying to run a ejb query on JBoss 4.0.5, using built in hypersonic db, For some strange reasons am able to fetch all objects from db without any where clause but if am using a where clause with an attribute name from the entitybean am unable to retrieve any results.
    I get an org.hibernate.QueryException, could not resolve property : "property name"
    My ejb query looks like this...
    SELECT template FROM TemplateSelect template WHERE template.template_name='Template_One'
    TemplateSelect is my entity bean class and I do have an attribute named template_name in my bean class.
    could any one please suggest me what could be wrong and also direct me to a good tutorial on ejb query language as well as I am fairly new to hibernate and ejb3 !
    tons of thanks in advance!
    pravin

    Hi Anuradha ,
    I'm afraid the query language does not support retrieving the date portion (i.e. truncating the time) from a date field.
    I propose you turn you named into a BETWEEN query taking two parameters one for the beginning of the day and another for the end of the day. Then your named query could look like:
    SELECT max(o.req_id) FROM requests o WHERE o.requestdate BETWEEN :start AND :end
    The following code creates two calendar instances for the current day, one for 00:00:00 and another for 23:59:59:
    Calendar start = Calendar.getInstance();
    start.set(Calendar.HOUR_OF_DAY, 0);
    start.set(Calendar.MINUTE, 0);
    start.set(Calendar.SECOND, 0);
    start.set(Calendar.MILLISECOND, 0);
    Calendar end = Calendar.getInstance();
    end.set(Calendar.HOUR_OF_DAY, 23);
    end.set(Calendar.MINUTE, 59);
    end.set(Calendar.SECOND, 59);
    end.set(Calendar.MILLISECOND, 999);
    Here is some sample code that creates a query instance for a named query called findMaxRequestPerDay and passes the Date of the above Calendar instance as actual parameter values. It assumes the named query is called findMaxRequestPerDay and the req_id field is a long:
    Query query = em.createNamedQuery("findMaxRequestPerDay");
    query.setParameter("start", start.getTime());
    query.setParameter("end", end.getTime());
    Long max = (Long)query.getSingleResult();
    I hope this helps.
    Regards Michael

Maybe you are looking for

  • NEED HELP PLEASE Setting up 2 VLANS and a redundant WAN connection

    I have a remote branch office which is actually a huge bar/lounge. The bar wants to enable patrons to access the Internet with their wireless laptops. I want to prevent those patrons from accessing our private network, and also prevent them from trav

  • How to enable triplefinger swipe gesture on Windows 8.1?

    I've tried to modify the about:config section with no success. It works only the ALT+TwoFingerGesture to go back and forward on history. In explorer I can go back and forward with a three finger swipe gesture, can it be enabled on firefox?

  • 80GB classic hard drive problem

    Ive had the ipod for just over 2 years (typically just out of warranty), and the hard drive has started to do the dreaded click of death when booting up. Ive left it on the charger, and eventually (sometimes half an hour later), it will boot up. Howe

  • Mapping element from a different line item

    Hi Experts, I have a structure that looks like this, LINE line1   item1   item2 line2   item1   item2 line3   item1   item2 and the target structure will look like this, SEGMNT line1   item1   item2 line2   item1   item2 line3   item1   item2 Now, if

  • Disable the screen field of  quantity field

    This User Exit is required for Validation check for Partial Delivery in reservation Using T.Code MB22 the quantity in reservation once created and partial issue has been completed then it should not be allowed to change the qty. Quantity change can t