Skip to Main Content

Analytics Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQL in custom folders of Appilcations Mode EUL

TR7Jan 5 2020 — edited Jan 9 2020

When working with an Oracle BI Discoverer 11.1.1.7 Applications Mode EUL associated with an instance of Oracle EBS R12.2.4 that uses EBR (Edition-Based Redefinition or "online patching"), should all SQL in Discoverer custom folders follow the standard described on page 4-13 of the "Oracle E-Business Suite Concepts Release 12.2" guide (Part No. E22949-12) that states: "All code (Oracle E-Business Suite, custom, or third-party) must access Oracle E-Business Suite data via the cover layer: accessing the data model via the physical layer may result in obsolete data been returned ... The implementation of EBR for Oracle E-Business Suite requires all code to access the data model via the APPS synonym, which points to the editioning view (logical model)."

In other words, should all SQL in custom folders refer to APPS synonyms instead of referencing tables via schema names?

Comments

564514
this class oracle.jbo.domain.Date don´t have this constructor oracle.jbo.domain.Date ( java.util.Date date)


you can change your java.util.Date for a java.sql.Date and you can do your parse more easy
456775
My code above is only for testing problem not real life program. In real code one object is java.util.Date and second is taken from database row implementation (in database DATE and in ViewObject is oracle.jbo.domain.Date). To compare both I use equals() metod.Of course as I hope is clear from first message not directly but with result of getValue() method.
Jan Vervecken
hi

As much as this looks like a bug, it also looks like a "documented feature".
see http://java.sun.com/j2se/1.5.0/docs/api/java/sql/Timestamp.html

"Note: This type is a composite of a java.util.Date and a separate nanoseconds value. Only integral seconds are stored in the java.util.Date component. The fractional seconds - the nanos - are separate. The Timestamp.equals(Object) method never returns true when passed a value of type java.util.Date because the nanos component of a date is unknown. As a result, the Timestamp.equals(Object) method is not symmetric with respect to the java.util.Date.equals(Object) method. Also, the hashcode method uses the underlying java.util.Date implementation and therefore does not include nanos in its computation."

"Due to the differences between the Timestamp class and the java.util.Date class mentioned above, it is recommended that code not view Timestamp values generically as an instance of java.util.Date. The inheritance relationship between Timestamp and java.util.Date really denotes implementation inheritance, and not type inheritance."

regards
Jan Vervecken
Jan Vervecken
hi

But, also the java.util.Date equals() method is documented with:
"Thus, two Date objects are equal if and only if the getTime method returns the same long value for both."
see http://java.sun.com/j2se/1.5.0/docs/api/java/util/Date.html#equals(java.lang.Object)

And in your example, this ...
System.out.println("oraDate.getValue().getTime() = " + oraDate.getValue().getTime());
System.out.println("utilDate.getTime() = " + utilDate.getTime());
results in this ...
oraDate.getValue().getTime() = 1172737018000
utilDate.getTime() = 1172737018000
Interesting question, maybe someone with more "date experience" can answer this.

success
Jan Vervecken
456775
thank Jan for your replies, and sorry for my delay - I was far from computers recently :-).
For me it is not problem with java.util.Date and java.sql.Timestamp but oracle.jbo.domain.Date. It results from how java.util.Date and java.sql.Timestamp relates and that in Timestamp class some methods are overridden. Instead of casting to java.util.Date in return of getValue() method of oracle.jbo.domain.Date class should be creating new java.utilDate object. This way always result from getValue() will always be java.util.Date.
And, more general, it is also very good example how careful one should be with casting. Thou casting in oracle.jbo.domain.Date.getValue() is valid, results in very error prone design.
Jan Vervecken
hi Remi

I understand your issue results from the oracle.jbo.domain.Date class implementation.

But, because "the inheritance relationship between Timestamp and java.util.Date really denotes implementation inheritance, and not type inheritance" a discussion about this becomes more confusing because the term "is a" no longer has its typical semantics.

regards
Jan
456775
Hi Jan,
yes you're of course right about merit of this problem. But I think that if it is possible to make something clear why not to do this way? If oracle.jbo.domain.Date.getValue() would return always java.util.Date (as it is the case when not using casting but new java.utilDate() ) error prone situation would no longer exist. And I suppose this change is safe for existing applications code.
Jan Vervecken
hi Remi

Indeed, this could benefit from some clarification.

If only someone from Oracle would point us to some documentation we missed or give some other kind of explanation.

regards
Jan
1 - 8

Post Details