Setting new Date() in a JPQL field

I have written a system where dynamic query is created on-the-fly using a query criteria builder class. Now when a date is passed in.
     * set the value to be used as an equal to search for createDate
     * @param Date - createDate
    public void setCreateDate(Date createDate)
        setParameter(CREATE_DATE, new Date());
    }Now, the problem is the query created is something like
p.createDate = Fri Dec 21 00:00:00 PST 2007and this stuff throws an IllegalArgumetException while creating the query because of the Fri token.
My question is how else do I set a date object into JPQL without causing this exception.
Michael

I have discovered my first mistake. I was using my criteria class to build a JPQL. using a StringBuffer to concatenate the fields and their values. The problem with dates is that on appending the a toString() is generated for the date object and that String is the cause of the IllegalArgumentException when the query is created.
So, I am looking for a way get the Date object in place instead of its toString()
Thanks

Similar Messages

  • How to set default date value to a field on screen

    How to set default date value to a field on screen and allow users to modify it ....

    Hello,
    In the PAI module, you need to save the changes to the database using the command MODIFY.
    Follow an example:
    Create or change a message in database table T100. If there is no message with the number 100 in the MYMSGCLASS message class in English, it will be created. Otherwise only the text is changed.
    DATA message_wa TYPE t100.
    message_wa-sprsl = 'EN'.
    message_wa-arbgb = 'MYMSGCLASS'.
    message_wa-msgnr =  '100'.
    message_wa-text =  'Some new message ...'.
    MODIFY t100 FROM message_wa.
    Regards.

  • How to add new data element to field list

    Hi,
    I am implementing Succession Planning 3.0 SP1.
    To make new data element was successful.
    I want to use them as sort field, however I don't know how to add them to the list of fields with caption.
    (i.e. to setting Visualize>My Org Units>Sort Fields)
    If you know how to config data elements usw. Please advise.
    Best Regards,
    Hiroshi Takimoto

    Hi Hiroshi,
    There are 2 ways to do this, both involving some customization of the application.
    1) Extend your HR-OCI views (TMC_O_SUCC_T & TMC_O_SUCC_B for My Org Units and TMC_IN_REP_T_DT & TMC_IN_REP_B_DT) to include Short Name. You probalby want to seek help from an OM consultant if this is not your area of expertise.
    2) Create a linked data element that links together the existing data elements and a new data element which includes Short Name. Your new data element must have the name of the existing data elements or you should change the hierarchy configuration that uses these data elements. Beware that this can prove troublesome for the Position Hierarchy because of the "virtual root" that is created - sometimes the join does not work because of this.
    Best regards,
    Luke

  • Set new Required Field for MD14 and MD15 for conver from Planned order to P

    Dear all,
    I would like to set new required field (Purchasing Organization)  in T-CODE MD14 and MD15 for convert from Planned Order to PR. What's should I do?
    Please help, I 'm new for MRP.
    Best Regards,
    Kate

    Hi Kate,
    You are not on the right track; MD14 and 15 will choose the PLANNED ORDER population for the conversion. In planned orders there's NO PURCHASING ORGANIZATION DATA (normally)!
    So even if you managed to put the field on the screen, it will not do anything that makes sense.

  • How to set a default date for a custom field of Date type in project server 2010.

    hi,
    can somebody help  me.
    How Can i set the default date for a custom field of date type in project server 2010 ?

    Dear Rohan,
    You can set default value to custom field thru Lookup table. Assign lookup table to custom field and set default value to some lookup value (Note: check the “Choose a value to use as a default when adding new item” checkbox).
    Regards,
    Avinash kumar | Blog:http://avigr8.wordpress.com | If you found this post helpful, please “Vote as Helpful”. If it answered your question, please “Mark as Answer”.

  • In new iPad 4g, when sim card is not inserted, I can not find the enable 4g tap in the setting-cellular data tap, can some one please tell me if this is normal and if so, then when it appears, thanks

    In new iPad 4g, when sim card is not inserted, I can not find the enable 4g tap in the setting-cellular data tap, can some one please tell me if this is normal and if so, then when it appears, thanks

    If the SIM is out of your phone, find my phone needs a data connection, so could use wifi - IF in range of a wifi and one that it can join (ie. a known network or one that is wholly open so no login required).  Your phone could also simple be turned off, so not findable, or it may have been restored (plugged into iTunes and restored as new) again, making it permanently unfindable.  Honestly, for someone stealing an iPhone, this is likely the first thing they do - restore as new and it is theirs forever.
    Find my iPhone is tied to the users iCloud account - the find function is part of the iCloud account's services and it communicates with the iCloud servers over a data connection - either wifi or 3G.
    Have you set up your iCloud account on your replacement phone, and is it working properly on that phone?

  • Adding new date field to already loaded data target.

    Hi,
        we have a cube containing date feild such as 0CALMONTH. the data is being loaded to the cube. now they have added new date feild (0FISCYEAR). how to get data to this feild. there is no data coming from source system for this feild. please can any one tell me how to include this feild and load data into it.
    with regards,
    sreekanth.

    Sreekanth,
       If Record creation date is the right field for deriving fiscal year, Why cant you derive the year from the date...by using automatioc time conversion...?? In update rules...??
      For exising data, you can do loop back to populate the data. see the below doc, for more info:
    https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/f421c86c-0801-0010-e88c-a07ccdc69601
    Hope it Helps
    Srini
    Message was edited by: Srini

  • How to add a new data element for existing table filed(Primary key field)

    Hi Experts,
    How to add a new data element for existing table field(Primary key field)
    For this filed ther is no foreign key relation ships and even check table.
    while activating table it is giving message like below.
    can you help any one to solve this and wil steps to add new dataelement for existing primary key filed of a table.
    Check table (NAMING SPACE/TABLE NAME(EX:/TC/VENDOR)) (username/19.02.10/03:29)           
    Primary key change not permitted for value table /TC/VENDOR
    Check on table  /TC/VENDOR resulted in errors              
    Thanks
    Ravi

    Hi,
    Easiest way is to download the table eg into an Excel table (if possible) or text table. Drop the table from the database. Build your table with the new key field. Build the database table again and fill it.
    You can do it also over the database into a new table. Drop the old one. Build the enhanced one and fill it. Afterwards drop your (temporary) table.
    Maybe there are other ways, but this works.
    Success,
    Rob

  • Error when trying to set a date type edit field

    Hi all
    I have an edit text field in a form which is bounded to a date type
    database field using dbDataSource.
    When i try to set the edit text field value with Today's date by code.
    I recieve an error message that the value which
    i'm trying to set is not legal. the  error number is [131-183].
    I use the following code to set the edit field:
    If oEditText.Value.Trim = String.Empty Then
                Dim strDate As String
                Dim sboBob As SAPbobsCOM.SBObob =
                 oCompany.GetBusinessObjec(SAPbobsCOM.BoObjectTypes.BoBridge)
                 rs = sboBob.Format_DateToString(Microsoft.VisualBasic.Today)
               strDate = rs.Fields.Item(0).Value.ToString().Trim()
    Try 
           oEditText.Value = strDate
    Catch ex As Exception
        SBO_Application.MessageBox("error setting
    current date: " & ex.Message)
    End Try
    End If
    My question is how can i set the edit field with a valid value?

    Hi!
    When writing to EditText.Value you must always use the B1 "DB-Format" as String.
    The following examples are assuming (it's a must!) that the EditText-Fields are bound to a corrosponding DataSource (Type Date, Price etc...)
    MyDateEditTxt.Value="20080207"
    MyPriceEditTxt.Value="1341.79"
    The best of it: It's Windows and SBO-GUI-Language independent.
    EditText.String must always be written with the format of the actual Language of the SBO-GUI, which can be changed by the user....
    You may also have a look at my statements regarding these problems near the end of this thread:
    [How to pass date value to an UDF;
    Cheers,
    Roland

  • Data arrived in ODS new data - all  data fields are cleared

    Hello Experts
    We are loading every day since 3 years data into a DSO   There is a simple start routine.
    Issue:
    Suddenly 1x  record out of 12'000 records loses the data fields or in other words the data fields are cleared. The key part of the record still extists. The table of new data shows the record with all cleared data fields. Thus before activation the data are lost already somwhere in updating.
    We dont use expert routines, no end routines ect. It is a simple 1:1 transformation with a simple start routine.
    We debugged the start routine and the record still exists correctly at the end of the start routine with all entries in the data fields.
    So quite tricky and we hope of some good ideas , you may help us.
    Thanks a lot for your input and help
    Christian
    Our system is SAP BW 7.01 on DB6

    Hello Raf
    The data request has been split in 2 x data packages.
    And the erroneous record was exactly the last data record in data package 1.
    I have than increased the data request size from 10’000 Records to 50’000
    records (default) and it worked than perfectly without clearing any data
    columns
    For me absolutely not understandable, why this can happen.
    Do you have an idea.
      Best regards
    Christian

  • How to set a date range for date field ?

    Dear Experts,
    Scenario:
    I have a query in validating the date field in my BSP application. My application is for maintain infotype 0023 Other/Previous Employers online by employees in the company.
    As per our design we are maintaining the all employment details of the employee both ( with in the current company / previous employment outside the company) in the same infotype.
    Every employee will have a hiring date within the SAP HR system. We consider this date as the cutoff date between current and previous employment in our application. When the employee updating the details wia BSP page I need to check the following.
    Record inside current company: Validation that, the user should only able to enter BEGIN DATE (BEGDA)  greater than or equal HIRING DATE and END DATE(ENDDA) should be greater than FROM  DATE (BEGDA).
    Record outside current Company: Validation that, the user should only able to enter BEGIN DATE (BEGDA)  less than or equal HIRING DATE and END DATE (ENDDA) should be greater than FROM  DATE (BEGDA) and less than HIRING DATE.
    Technical Requirement:
    How to set a date range for date field, i.e. how we can limit the date range in a HTMLB date field? Can this it be achieved via standard functionality of HTMLB?
    Following is the code to describe date field in my application.
        <htmlb:inputField id= "ENDDA_NEW_IN"
                          type= "date"
                    doValidate= "TRUE"
                      showHelp= "TRUE"
                      disabled= "FALSE"
                         width= "183"
                         style= "cssTextAreadate"
                         value= "<%='99991231'%>"/>
    Thanks a lot in advance for your assistance and help.
    Cibinu2026
    Edited by: cibin kuruvilla on Nov 12, 2008 11:13 AM

    Hi,
    This functionality is known to be very important and is a key part of the next major release of the JRC planned for the first half of 2008.
    Regards,
    <p>Blair Wheadon</p>
    <p>Product Manager, Crystal Reports</p>

  • How to set todays date in message date input field in uix

    Hello everybody,
    Im using jdeveloper 9015+adf+uix
    I am having an input form and in that i want to set the date input field with the current date(default value).
    Does anybody of you know how I should do this.
    Any help is appreciated,
    Thanks in advance

    Hi,
    Did you figure out on how to default system date in a date input field??
    I have a similar requirement in OA framework. Please let me know if you have any ideas.
    Thanks,
    vinay.

  • Adding a new field and new data item breaks layout

    I am adding a new field to a subform and populating it form a .Dat unfortunatly adding this field is causing data outputed to the subform below it to shift down one line on the page when outputted.
    This new field is outputted at the top of the form and and the line being shifted are below this.
    Below is the field details and the field as it is in the .dat file.
    Field:F_PO_NUMBER [1]                                
    Lines: 1  Characters: 20  Angle: 0
      In Subform
    : Main_Page
      Options  
    : Global
    ^Command JFPAGE_START
    ^Undefine global:~^PAGE 1
    ^define global:SEQUENCE \pic"NUM999999",@D:NUMPAGESPRINTED../\pic"NUM99",@$PAGE../\pic"NUM99",@:JFPAGE_PAGE_OF..
    ^define global:JFPAGE \pic"NUM99",@$PAGE.. of \pic"NUM99",@:JFPAGE_PAGE_OF..
    ^GLOBAL Email COLL_TEL_NUM~12345678~^REFORMAT OFF
    ^GLOBAL F_CURRENCY_CODE
    GBP
    ^FIELD F_PO_NUMBER
    ^COMMENT R_remit_customer
    ^FIELD F_REMIT_TO_CONCATENATED
    Address
    ^COMMENT M_INVOICE_HDR_BOX1
    ^GLOBAL F_TRX_TYPE
    Invoice
    Now the weird party is if I move the new field in the .dat as below it fixes things and the everything lines up like it should do.
    ^Command JFPAGE_START
    ^Undefine global:~^PAGE 1
    ^define global:SEQUENCE \pic"NUM999999",@D:NUMPAGESPRINTED../\pic"NUM99",@$PAGE../\pic"NUM99",@:JFPAGE_PAGE_OF..
    ^define global:JFPAGE \pic"NUM99",@$PAGE.. of \pic"NUM99",@:JFPAGE_PAGE_OF..
    ^GLOBAL Email COLL_TEL_NUM~12345678~^REFORMAT OFF
    ^GLOBAL F_CURRENCY_CODE
    GBP
    ^COMMENT R_remit_customer
    ^FIELD F_REMIT_TO_CONCATENATED
    Address
    ^COMMENT M_INVOICE_HDR_BOX1
    ^FIELD F_PO_NUMBER
    ^GLOBAL F_TRX_TYPE
    Invoice
    ^FIELD F_TRX_NUMBER
    I hoping someone might have an idea of why this is the case as I'm at a loss regarding why its happening.

    I may not hit on it exactly, but this sounds like Adobe's processing order.
    It wants to process the fields in the order they are in the DAT file.
    I have a similar problem with an overflow field, that isnt last in the DAT file,
    Read this here:
    http://forums.adobe.com/message/2298283#2298283
    Now that may not be exactly your issue, but I think its the same inherent problem,
    Adobes processing order for the fields/subforms.
    I am still trying to resolve my issue, but found the ^field command in the reference manual (Print Agent),
    and am wondering if I can use it.

  • How to set the data fields column wide at sqlplus

    Dear Sir/Madam
    I would like to know how to set the data fields column wide at sqlplus
    Thanks
    Francis

    see
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch6.htm#sthref1131
    and the FORMAT clause of the COLUMN command in
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14357/ch12013.htm#BACHCABF

  • How to update multi-handle graph with a new set of data points

    I have multiple sets of data that all have the same number of columns but different numbers of rows. Each column is plotted on a graph. I want to keep the format of the original graph with the same number of handles, and update each handle with new data points by bringing in a new set of points.
    See attachment for example.
    Attachments:
    hiqgraph.HiQ ‏14 KB

    There are several ways to do this.
    1. You can create a HiQ script that plots the new data to the graph using the existing plots. The following three lines plot the new data into the three existing plots (indicated by the plot handles.) Put these lines into a HiQ script object, right-click and select Run.
    addplot(Graph2D_1,-1,data2[*,1],data2[*,2]);
    addplot(Graph2D_1,-2,data2[*,1],data2[*,3]);
    addplot(Graph2D_1,-3,data2[*,1],data2[*,4]);
    2. You can do it interactively by right-clicking on the individual plots and choosing Change... This will being up a dialog you can use to change the data in that plot. This will be difficult to do when plots are right on top of each other, so you may want to display the plot legend, where you can also right-click a
    nd select Change...
    3. I like your idea about DataSocket. This way it will happen automatically. Whenever the matrix published to DataSocket changes, the plot should automatically update.
    I hope this helps.
    David

Maybe you are looking for

  • HD cam with FCP 5.1.4 ?

    Hi everybody, as I encounter big problems with my DV Canon XM1, I plan to buy a new one maybe HD cam. I saw that most of those cams have USB connection and no more FW, will I be able to capture an HD cam from FCP ? I doubt of it but can you tell me h

  • How to use Notes in Mail?

    .. e.g. 1. Where are Notes saved on a MacBook after File > New Note ... write note ... File > Save? 2. Can you write a Note in OS X Lion Mail / MacBook, and end up with it in Notes on an iPad/iPhone? The above covers it, the rest is a rant. First, wh

  • How do i get my nokia n8 to print to my officejet pro 8500a?

    Hello Can anyone tell me how to get my Nokia N8 mobile phone to print a photo using HP Officejet Pro 8500A? I have got the wireless connection enabled, but when I select the photo on the phone and click on Print, via Bluetooth connection, the Printer

  • How can I get my outlook 2011 to print a list of attachments to a message

    I can't get my Outlook to print a list of attachments when I print a message.

  • R/3 is slowing down when BW jobs triggers.

    Hi Experts, We have a severe performance problem with R/3 whenever BW jobs scheduled to bring the data from R/3. Can anyone through some ideas why this is happening? Thanks & Regards, VSN.