Sunday, August 23, 2015

What are the java classes generated from EO and what are their uses?

1. Entity Object Class: Most frequently used for customizing business logic. for e.g.: to prevent an update on specific attributes setAttributeInternal() method is used

2. Entity Collectin Class: Customize default entity caching implementation. for.e.g: custom logic for cleaning up cache rows

3. Entity Definition Class: Customize default entity definition implementation. for e.g: modify properties of entity object or attributes at runtime then override resolveDefObject

What are the different ways to create EO


  1. Using Tables
  2. Using Views, but view should be updatable. Views can inherently updatable or you can create INSTEAD OF trigger on view to make it updatable.
  3. Overriding doDML method
  4. Synonyms: Its an alias for any table or materialized view
  5. Materialized view: Its a database object which contains the results of a query
Note: If primary key is not inferred then framework will create an attribute RowId with primary flag checked

How to make one of the attributes of EO saved in uppercase

In the EntityImpl getter class, return the string with upper case:
For e.g:- Name attribute should be changed to uppercase after commit:
    /**
     * Gets the attribute value for Name, using the alias name Name.
     * @return the value of Name
     */
    public String getName() {
        System.out.println("EO getName method");
        String name =(String)getAttributeInternal(NAME);
        if(name!=null){
            return name.toUpperCase();
        }
        else{
            return (String)getAttributeInternal(NAME);  
        }      
    }


Monday, August 17, 2015

When should i extend the Exception Class?

Following are some of the reasons why you
want to do this are to:


  • Customize the exception error message
  • Use error codes to locate the error messages in the resource bundle
  • Use a single resource bundles per locale for the error messages and the error message parameters
Ok...but how to do this?

Create a new class and extend oracle.jbo.JboException

Thursday, August 13, 2015

What should i do if my layouts in the Jdev get messed?

For e.g: structure window/log/property palette is docked at an unwanted position by mistake while dragging!

From the tool bar select Windows > Reset windows to Factory Setting :)

Tuesday, August 11, 2015

Why Confused?

I work on Oracle ADF, as its a vast framework used for developing enterprise applications. There are a lot of concepts and scenarios where we need to think which might fit best to the scenario. There are many ADF experts available in Oracle ADF/ Jdev Forum. But this blog is a small effort to differentiate and help understand and eliminate such day-to-day confusions for ADF beginners :)

Whether to use jsp or jspx while creating a page?

While create a page in ADF, there are 2 options whether to use jsf or jspx:










On selection of the Facelets option untitled.jsf file will created and on selection of JSP XML untitled.jspx file will be created. Here lies the confusion...which one to choose??

While searching for this answer came across Frank Nimphius's answer:

"Usually Facelets is considered to be of better performance because it is tighter integrated with the JSf lifcycle and doesn't need to be compiled before running it. Anyway, to lift the FUD:

1. JSPX documents and Facelets are both supported with JDeveloper 11g R2 and we do       
    support them equally in functionality (very little differences exist on both sides)

2. JSPX documents are the only choice in JDeveloper 11g R1

3. The future speaks Facelets (according to the JSF specification) and if you starting a new       
    development project with JDeveloper 11g R2 then we recommend you use Facelets because 
    of this

4. If you are on JDeveloper 11gR1, don't panic, you are good to go and we make sure your 
    applications upgrade nicely to 11g R2 and 12c (later)

5. We plan on providing a JSPX to Facelets migration in JDeveloper. Until then, JSPX are a 
    first class citizen as Facelets is too

6. When you are on JDeveloper 11gR1, don't wait for 12c if you need to start a development 
    project."

No more confusion :)