2 Replies Latest reply on May 8, 2012 4:23 AM by Mohammad Jabr

    BUG: When convert attribute's type from TimeStamp to Date in 11.1.2.1.0

    Mohammad Jabr
      I think there is a bug in Jdeveloper 11.1.2.1.0, and I could re generate it in HR schema. The steps to re generate it are.
      1- JOB_HISTORY table in HR schema has two columns (START_DATE and END_Date) of type Date.
      2- Create ADF business component based on JOB_HISTORY table.
      3- Jdeveloper will by default set the type for StartDate and EndDate attributes to oracle.jbo.domain.Timestamp.
        <Attribute
          Name="StartDate"
          IsNotNull="true"
          ColumnName="START_DATE"
          SQLType="DATE"
          Type="oracle.jbo.domain.Timestamp"
          ColumnType="DATE"
          TableName="JOB_HISTORY"
          PrimaryKey="true"/>
        <Attribute
          Name="EndDate"
          IsNotNull="true"
          ColumnName="END_DATE"
          SQLType="DATE"
          Type="oracle.jbo.domain.Timestamp"
          ColumnType="DATE"
          TableName="JOB_HISTORY"/>
      4- I changed the the type for both attribute in EO to oracle.jbo.domain.Date.
      <Attribute
          Name="StartDate"
          ColumnName="START_DATE"
          SQLType="DATE"
          Type="oracle.jbo.domain.Date"
          ColumnType="DATE"
          TableName="JOB_HISTORY"
          PrimaryKey="true"/>
        <Attribute
          Name="EndDate"
          ColumnName="END_DATE"
          SQLType="DATE"
          Type="oracle.jbo.domain.Date"
          ColumnType="DATE"
          TableName="JOB_HISTORY"
          PrimaryKey="true"/>
      5- Run the application module, double click on JobHistoryView1, you will see this exception.
      (oracle.jbo.AttrValException) JBO-27019: The get method for attribute "StartDate" in JobHistoryView1 cannot be resolved.
      ----- Level 1: Detail 0 -----
      (java.lang.ClassCastException) oracle.jbo.domain.Date cannot be cast to oracle.jbo.domain.Timestamp
      
      (oracle.jbo.AttrValException) JBO-27019: The get method for attribute "EndDate" in JobHistoryView1 cannot be resolved.
      ----- Level 1: Detail 0 -----
      (java.lang.ClassCastException) oracle.jbo.domain.Date cannot be cast to oracle.jbo.domain.Timestamp
      This did not happen in Jdeveloper 11.1.2.0.0.

      Your suggestion please?
        • 1. Re: BUG: When convert attribute's type from TimeStamp to Date in 11.1.2.1.0
          vinod_t_krishnan
          Was there any Java Impl class created for the EO which still refers to oracle.jbo.domain.Timestamp?
          1 person found this helpful
          • 2. Re: BUG: When convert attribute's type from TimeStamp to Date in 11.1.2.1.0
            Mohammad Jabr
            Thank you Vinod for your hint.
            No there is no method in JobHistoryImpl class still using TimeStamp.
             import oracle.jbo.domain.Timestamp;
            
                  /**
                * Gets the attribute value for StartDate, using the alias name StartDate.
                * @return the value of StartDate
                */
               public Timestamp getStartDate()
               {
                  return (Timestamp)getAttributeInternal(STARTDATE);
               }
               
                      /**
                * Sets <code>value</code> as the attribute value for StartDate.
                * @param value value to set the StartDate
                */
               public void setStartDate(Timestamp value)
               {
                  setAttributeInternal(STARTDATE, value);
               }
               
               /**
                * Gets the attribute value for EndDate, using the alias name EndDate.
                * @return the value of EndDate
                */
               public Timestamp getEndDate()
               {
                  return (Timestamp)getAttributeInternal(ENDDATE);
               }
               
                 
                 /**
                * Sets <code>value</code> as the attribute value for EndDate.
                * @param value value to set the EndDate
                */
               public void setEndDate(Timestamp value)
               {
                  setAttributeInternal(ENDDATE, value);
               }
               
            However, the JobHistoryViewRowImpl class is still using TimeStamp even after change the type in the EO !!!!.