Domain.Date / Documentation Bug??

Hi,
The documentation for addMonths() in domain.Date states that the method overrides addMonths() in sql.Date to return a domain.Date.
It doesn't. It still returns a sql.Date.
Am i wrong??
Enjoy!!

Hi
The domain.Date:
addMonths
public DATE addMonths(int months)Adds months to a date. Overrides the oracle.sql.DATE method of the same name to return a Date Domain object.
Returns:
new Date object initialized to the Date value added to months. Months can be negative to perform month subtraction.
See Also:
"oracle.sql.DATE"
package mypackage1;
import oracle.jbo.domain.Date;
public class Class1
public Class1()
public static void main(String[] args)
Date date1 = null;
Date date2 = new Date();
date1 = date2.addMonths(1);
Error(16,28): incompatible types; found: oracle.sql.DATE, required: oracle.jbo.domain.Date
What am i doing wrong??

Similar Messages

  • Jbo.domain.Date - what the heck is ...

    Hello,
    I am trying to import some data from file into view. I get my hands on ViewObject, I createRow() and ... when I try to set my jbo.domain.Date mapped attribute with row.setAttribute("StartTime", date), where Date is a valid java.util.Date (or was it java.lang.Date ... ?) I get this scarry message that says "oracle.jbo.domain.DataCreationException: JBO-25009: Cannot create an object of type:oracle.jbo.domain.Date with value:27-02-2000:12:58:0
    ". Now, I know that I am doing something wrong here, but what? I ___really___ tried to find something about this jbo.domain.Date class but it is very mysterious. I found no documentation whatsoever ...
    Can anyone help me with this one ?
    thanks in advace ...
    Filip Kierzek
    null

    There is a bug logged for the missing documentation. I'd recommend that you do a search on this forum for "domain.date". There were some good threads a while back that have some examples of using dates.
    -- Brian
    null

  • Oracle.sql.DATE documentation also missing

    Thanks for the documentation of jbo.domain.Date, but it was not enough.
    I need to know how to use the toDate method, but it seen to be described in the superclass
    oracle.sql.DATE that was also missing in documentation.
    I have searched at OTN docs, but it's also missing there.
    There is some place where this documentation is stored in OTN, since could be others classes missing.
    Thanks for the support.

    I'm trying to set a date value and keep getting a ClassCastException:
    rsaDemandException is a ScrollableRowsetAccess object
    "StartDate" is a valid Date type column in the DemandException view object
    newDate is a Date object of the various types I have tried below
    The line that causes an exception to be thrown:
    rsaDemandException.setColumnValue("StartDate", newDate);
    I've tried the following objects for newDate
    java.util.Date;
    java.sql.Date;
    java.sql.Timestamp;
    oracle.sql.DATE;
    oracle.jbo.domain.Date;
    None of them work. They all throw a class cast exception.
    Any hints on what I need to do? Or is this some bug?
    null

  • Issue when SelectOneChoice is used with Domain data type in JDev 11.1.2.0.0

    Hi,
    I am facing one issue while working with SelectOneChoice along with Custom Domain data type. Sample app to simulate the issue is available at http://www.filejumbo.com/Download/6FDF6ECF2922BD24
    Issue Details.
    Base view object’s attribute is of type CustomString, for which another static VO’s attribute is attached as LOV. LOV attribute is of type String. Because of this data type mismatch between LOV VO attribute and Base VO attribute, while working in screen, initially we were facing Class cast exception.
    Cannot convert <<LOV Attr. Val.>> of type class java.lang.String to class model.domain.common.CustomString This is not only for this type of SelectOneChoice but also for InputText field whose underlying VO attribute is of type CustomString (i.e. any Custom Domain type)
    On raising this in Jdeveloper forum, I came to know that adding a default oracle converter against the UI Component will take care of converting to respective data type. After added the converter for InputText and SelectOneChoice components, this issue got resolved. This was our lesson while working in Jdeveloper version 11.1.1.3.0. Converter we used,
    <f:converter converterId="oracle.genericDomain"/> When we try the same scenario in Jdev Version 11.1.1.4.0, without having the oracle converter itself, SelectOneChoice started working fine!! (i.e. it is able to set the base attribute with LOV attribute’s value but with proper base attribute’s domain data type). Anyhow, converter is required for InputText.
    When we try the same scenario in Jdeveloper new version 11.1.2.0.0, it started giving class cast exception when we don’t have oracle converter for SelectOneChoice. But by adding it, though it didn’t give such class cast exception message, though a selection is made in SelectOneChoice, VO attribute has not been updated with the new value. Instead it is updated with null value (Checked the setter method of view row impl by having break point) . Because of this, after a selection is made, when we try to read the attribute value from VO on button click, VO attribute always returns null.
    We have also tried our own converters but there is no change in the behavior.
    The above misbehavior can be tested either by having SOP programmatically or by refreshing the SelectOneChoice by giving its id as Partial trigger to itself with autosubmit set to true, so that the selected value will be reset to null irrespective of the selection made.
    For convenience, Issue details with Sample application is shared. Shared link : http://www.filejumbo.com/Download/6FDF6ECF2922BD24
    Shared folder contains
    1. Sample App developed on Jdev 11.1.1.4.0 to ensure it didn’t give this error.
    2. Sample App developed on Jdev 11.1.2.0.0 to simulate this error.
    3. Error details in a document.
    Can anybody have a look at this and tell me why this misbehavior and is it a bug? If so, any workaround available to continue the development?
    Thanks in Advance.
    Raghu
    Edited by: Raguraman on Sep 10, 2011 10:31 AM

    Sorry for the late reply John and Frank. Ya i did. Thank you.
    One more detail:
    I tested the behavior in Jdeveloper 11.1.2.0.0. The recent surprise is Select One Choice is behaving perfectly when it used in Grid layout and fail to work when it is form layout. I am getting surprised why behavior of component varies based on the way it refers the binding.
    for form layout,
    value=#{bindings.
    for grid layout,
    value=#{row.bindings.
    The bug details (#/title) are Bug 12968871 - RUNTIME CONVERSION FAILURE WHEN USING CUSTOM DOMAIN OBJECT VALIDATION IN EO
    Edited by: Raguraman on Sep 12, 2011 8:23 PM
    Edited by: Raguraman on Sep 12, 2011 8:31 PM

  • GetCurrentDate() not found in  oracle.jbo.domain.Date;

    Is it a known bug.
    Then how do we get the current date and time?
    Thanks in advance.

    Viani - you're right, but oracle.jbo.domain.Date is definitely not right - see Calendar as suggested above.
    John

  • How do I use oracle.jbo.domain.Date truncate() method?

    Hello -
    I want to get the equivalent of "trunc(SYSDATE)" in the form of an oracle.jbo.domain.Date instance.
    I think I can do this by getting the current date and truncating the time portion:
    Date myDate = Date.getCurrentDate();
    myDate.truncate(some_precision_string);
    Issue is: what do I use for the precision string? (Javadoc for class (and its parent) is not helpful...)
    Thanks,
    -- Scott

    Nevermind. Apparently these methods don't really exist.
    (Although documentation in 9.0.3.3 JDev under Help -> Help Topics -> Contents Tab -> Reference -> Business Components Oracle Domains (this one is a javadoc page) say that they do....)

  • Set oracle.jbo.domain.Date object to null

    Hi
    We have a case where we need to set a Date value to null.
    We have tried row.setCxdDate(null) and row.setCxdDate(new Date("")), but to no avail.
    When we call DBTransaction.commit() in the application module, all the other changes are persisted to the database, except for the date. No exceptions are generated at all.
    I have searched through these forums, and the only thing I have come up with, was that this was filed as a bug to be fixed in the 9.0.3 release; we are using 10.1.2!
    Does anyone know how to solve this?
    TIA
    Gareth

    It returned "1970-01-01"
    By the way I found that there is one method getTime() in oracle.jbo.domain.Date class
    http://otndnld.oracle.co.jp/document/products/as10g/101300/B25221_03/web.1013/b16007/oracle/jbo/domain/Date.html used in 10.3
    But could not find it while using in JDeveloper 11.1.1.3 <http://download.oracle.com/docs/cd/E17904_01/apirefs.1111/e10653/oracle/jbo/domain/Date.html>
    Edited by: Moinak on Mar 4, 2011 7:08 AM
    Edited by: Moinak on Mar 4, 2011 7:10 AM

  • SQL DM - Copy/Export data models - bug?

    SQL DM - Copy/Export data models - bug?
    I am using SQL DM 3.0.0.665. I need your thoughts on following.
    We used saved as/export of the SQL DM copy the model into another location. We kept our models in harddrive as folder. We did not store it in database.
    We opened the copied model from target model. We found all the links to defined domain was lost. We find the data type shows as Varchar2 instead of Varchar2(20)etc. It creates error on sql.
    Why are loosing the domain definition/linkages during export/save as option?
    Is it a bug?
    Did anyone face such issues?
    What is the workaround?
    Thanks in helping us out.

    Hello,
    Thanks for your reply. I followed the steps. I did copy the folders/files as Kent suggested.
    As we installed the SQL developer on new desktop, it showed the domain definitions as unknown and count as 1 in Design Tree --> domain node. We copied all the xml files under C:\datamodeler\datamodeler\types folder of Desktop A to Desktop B. It brought all the domain definitions of Design in Desktop A.
    Why does it not keeping this domain definitions as part of Design folders?
    If we copy or save as the design , then domain also cane be saved as part of design. It will be difficult to make a sync of datamodels among multiple desktops.
    How do we establish a shareable/sync data models using SQL data Modeler on such situations?
    Thanks in helping.

  • Getting Error:::oracle.jbo.domain.Date cannot be cast to java.lang.String

    Hi Friends,
    I have simple req'.
    i have one date filed in OAF page...if user has change the date filed..means if he incresed by 2 days..then i need to call one procedure..if not no need to call....
    first am picking that date field to by uusing prepared stmt and putting in to one variable..like below
    try {
    ps1 = am.getOADBTransaction().getJdbcConnection().prepareStatement("SELECT -------");
    ResultSet rs2 = ps1.executeQuery();
    while (rs2.next()) {
    schDate = rs2.getString(1);//storing the value
    } catch (Exception e) {
    throw OAException.wrapperException(e);
    Next..am picking the current value like this(user can change the value) like below...
    OAViewObject viewObj = (OAViewObject)am.findViewObject("simpleVO");
    String currSchDate = (String)viewObj.getCurrentRow().getAttribute("iDate");
    java.text.SimpleDateFormat dtFormat = new java.text.SimpleDateFormat ("MM/dd/yyyy");
    StringBuilder date = new StringBuilder(dtFormat.format(currSchDate));
    Then am comparing the values like below..
    if (schDate.equals(date)) {
    String outParamValue = "";
    String secondOutParamValue = "";
    but am geting the below error
    ## Detail 0 ##
    java.lang.ClassCastException: oracle.jbo.domain.Date cannot be cast to java.lang.String
         at xxuss.oracle.apps.abc.webui.xxPGCO15.processFormRequest(xxGCO15.java:594)
    Appriciate any help...its very urgent
    Regards
    Harry

    Instead of :
    String currSchDate = (String)viewObj.getCurrentRow().getAttribute("iDate");Try
    String currSchDate = viewObj.getCurrentRow().getAttribute("iDate").toString();
    -Anand

  • Getting an error in CMS..Domain Data

    Hello All,
    I just finished installing & configuring (including Post installation) JDI on EP6 SP15.
    Now in CMS, am getting an error as <i><b>cannot create directory: D:\usr\sap\JTrans/CMS/inbox</b></i> in Domain Data tab.. under Landscape Configurator
    I have created the JTrans and all required sub-folders & have also copied the required .sca files in<i> inbox</i> sub-folger as given in post installation doc.
    Any inputs...please guide...
    Awaiting Reply.
    Thanks & Warm Regards,
    Ritu

    Hi Siddharth,
    Firstly thank you for ur reply & excuse me for replying late.
    Can you please tell me how am to give permissions as u suggested in ur reply above.
    The inbox folder is accessible using Windows Explorer, so how to assign permissions. Should I share the folder?
    On other hand, am trying to understand this step. Is it that CMS is trying to create the inbox folder that I did already (referring to Post Installation Steps)?
    These are the initial values...that am trying to change:
    CMS URL= http://localhost:50000
    SLD URL= http://PWDF3013:50000
    Awaiting Reply.
    Thanks & Warm Regards,
    Ritu
    Message was edited by:
            Ritu  Hunjan

  • Adding one day to a oracle.jbo.domain.Date and truncating the time part

    JDev 11.1.1.4.0
    Hello
    I need to add a day to oracle.jbo.domain.Date and get back a oracle.jbo.domain.Date without the time part.
    So far I've got
    Date valueDate = (Date)rowCpt.getAttribute("ValueDate");                                       
    Calendar cal = Calendar.getInstance();
    cal.setTime(new java.util.Date(valueDate.timestampValue().getTime()));
    cal.add(Calendar.DATE, 1);
    Date newDate = new oracle.jbo.domain.Date(new Timestamp(cal.getTime().getTime()));This adds 1 day to the date but keeps the time part of the date.
    How do I get rid of the time part of the date ?
    Thanks
    Paul

    The Calendar class allows you to set or clear each field.
    Date valueDate = (Date)rowCpt.getAttribute("ValueDate");                                       
    Calendar cal = Calendar.getInstance();
    cal.setTime(new java.util.Date(valueDate.timestampValue().getTime()));
    cal.add(Calendar.DATE, 1);
    cal.clear(Calendar.HOUR);
    cal.clear(Calendar.MINUTE);
    cal.clear(Calendar.SECOND);
    cal.clear(Calendar.MILLISECOND);
    Date newDate = new oracle.jbo.domain.Date(cal.getTimeInMillis());should work.
    Timo

  • How to get the first day in the month from a domain date ?

    Hi,
    I like to know how to get the first day in the month from a domain date?
    Thanks
    Stephen

    Hi Gokul...
    Instead of using the funtion module you can just write the 3 statements of code to get the first day of the week.
    Its similar to the above one but instead of writing case statement you can achive the following.
    data : w_res type i,
             w_data type d,
    w_res = w_date mod 7.
    w_date = w_date - w_res.
    write w_date.
    This works.
    Regards,
    Siddarth

  • How to convert String (dd-MMM-yyyy) to oracle.jbo.domain.Date

    Hi
    Could you please tell how do I convert String of date in format dd-MM-yyyy to ADF date? Please show me some sample.
    Thanks

    http://javaalmanac.com/egs/java.text/FormatDateDef.html
    Once you have a java.util.Date you can convert it to oracle.jbo.domain.Date. (see http://www.fifkredit.com/bc4jdoc/rt/oracle/jbo/domain/Date.html)

  • How can i compare:  java.util.Date oracle.jbo.domain.Date?

    I have made a ViewObject wich contains a date column.
    I want to check if this date is smaller/greater than sysdate:
    i get following error:
    Error(45,24): method <(java.util.Date, oracle.jbo.domain.Date) not found in class Class4
    code:
    SimpleTimeZone pdt = new SimpleTimeZone(-8 * 60 * 60 * 1000, ids[0]);
    // set up rules for daylight savings time
    pdt.setStartRule(Calendar.APRIL, 1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
    pdt.setEndRule(Calendar.OCTOBER, -1, Calendar.SUNDAY, 2 * 60 * 60 * 1000);
    // create a GregorianCalendar with the Pacific Daylight time zone
    // and the current date and time
    Calendar calendar = new GregorianCalendar(pdt);
    Date trialTime = new Date();
    calendar.setTime(trialTime);
    (VO_ULNRow)singleRow = null;
    while(vo.hasNext()){                                             // ViewObject vo;
    singleRow = (VO_ULNRow)vo.next();
    if(calendar.getTime() < singleRow.getEO_ULN_BORROWFROM()); //singleRow returns oracle.jbo.domain.Date
    etcetera
    how can i compare those 2?

    Hi,
    oracle.jbo.domain.Date has two methods which suit your needs
    longValue() which returns a long (though I'm not sure if returns a long comparable to the long returned by java.util.Date)
    and dateValue() which returns a java.util.Date
    I hope it helps,
    Giovanni

  • Problems Validating an Attribute of type oracle.jbo.domain.date

    I have a form that has a date input field. I am trying to customise the exception error for this field for when the user enters something other than my dd/MM/yyyy format. ie JBO-25009: oracle.jbo.domain.DataCreationException
    This Attribute uses a the oracle.jbo.domain.date data type. An exception is finally thrown when the transaction trys to commit.
    My problem is that I can't customise the exception because I can't catch where it is occuring. I have tried at the <setAttributeInternal>, <setAttribute> and <validateEntity> levels uses both try{}catch(Jbo Exception){} and try{}catch(AttrValException){}. I believe the reason for this is because the problem occurs because the parse value to functions are invalid dates so it never enters them.
    If this is true validation and any exception thrown should occur at the data type level, but the the oracle.jbo.domain.date class doesn't have a validate method.
    Can someone please help me get around this problem. Or tell me if the have a solution for date input validation.

    The usecase is as follows:
    I have a DynaAction Form with a input field for a date value. This field in the form is associated with an entity attribute that is of the type oracle.jbo.domain.date
    In the message bundle for this entity I specify a format (dd/MM/yyyy) and formatter for the field (oracle.jbo.format.DefaultDateFormatter). In the jsp page I display the field using the following tag within the <jbo:row> tags,
    <jbo:InputDate dataitem="ChangeDate" formname="ApplicationReleaseForm"/>
    The date picker script works well here and the formatter formats it correctly.
    My error occurs when an invalid date value is entered. Ie characters like "abc" or numeric values that don't match a date format ie my date format (dd/MM/yyyy) or the default format of the jbo.domain.date type(yyyy-MM-dd).
    On submitting my form the input is posted to an action that extends the Update action class. I use the following expression to cache the input from the form in the viewobject:
    ActionForward actionForward = super.execute(mapping,form,request,response);
    The invalid input appears to be able to slip through this call without causing an exception, unless I make the attribute manditory. In this case an exception is thrown causing the form to be returned and the mandatory value error message to be shown.
    If the attribute is not mandatory the exception is not thrown until I make a call to commit; eg
    context.getApplicationModule().getTransaction().commit();
    The DataCreationException is the initial exception that is caught and causes the rest of the transaction to fall over.
    It is my understanding that if the input is wrong then it should be picked up when the form data is pushed into the viewobject, ie in the call to execute and at the setAttributeInternal() method call for the attribute in the viewobject. I don't believe that the input gets this far as the input is not a valid date, indicating to me that the oracle.jbo.domain.date should be the object throwing the exception.
    I hope this gives you a better understanding of the process and where and what causes the problem to occur.

Maybe you are looking for

  • Submit via JOB job NUMBER n

    I have an ABAP wrapper program that generates a job with multiple steps using JOB_OPEN, SUBMIT...VIA JOB and JOB_CLOSE. The generated job will have multiple steps and each step can have an error message. How do I code SUBMIT statement to allow proces

  • G-tech usb 2.0?

    hello all.  Im trying to connect a 1 tb g-tech drive to new macbook via usb 2.0 port and does not mount. comp does not seem to recognize drive.  I tried it on my old g5 as well and no dice. I'm wondering whats up since the drive has that interface wh

  • Install itunes 7.x.x.x twice

    Can I install the same version of iTunes twice on the same computer? I want to install it to two diff directories but can't work out how. Once I install it the first time the only option I am given the second time is to remove or repair. Thanks in ad

  • Fund Reservation

    Hi, I created a fund reservation with two line items. Each line item has a different order number. When the purchase order is created and the creator reference the order number for line item two of the fund reservation, it defaults to the order numbe

  • What Determines download speed using Wi-Fi on 4S?

    When downloading using Wi-Fi in a home or hotel, the speed is determined by the underlying carrier for the Wi-Fi, not the carrier for the 4S, correct?