Monday, September 7, 2015

How to set the default value of LOV?

There are 2 ways to default the value of LOV value:
1) From the model layer as explained in:
     http://husaindalal.blogspot.in/2010/05/how-to-default-lov-with-its-first-value.html
2) From the UI layer i.e. using the managed bean as explained in:
https://adfblog.wordpress.com/2014/02/21/how-to-display-default-valuesfirst-item-selected-in-selectonechoice/
    
   

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 :)