Difference between Managed Bean & Backing Bean

Difference between Managed Bean & Backing Bean

Difference between ManagedBean & Backing Bean in Oracle ADF

Both are same,but strictly speaking it is a Managed Bean. 

Managed Bean is "Simply a Java Class in which User Interface specific methods can be written". 

The reason for the two terms is that if a Managed Bean has a one to one mapping with a page & includes methods to access the UI components on that page,Then you can think of that Managed Bean as "backing" that page[i.e., Backing Bean]. 

Here Backing Bean Scope is limited to that page but Managed Bean scope is more than one. 

Here One to one Mapping Means"Allowing the pairing of each page uniquely with  a Java class"

difference-between-managed-bean-backing-bean-in-oracle-adf


Read More

Generating Sequence Number for PrimaryKey in Oracle ADF

Generating Sequence Number for PrimaryKey in Oracle ADF

Generating Sequence Number for PrimaryKey in Oracle ADF

It can be done in many ways using programmatic  and declarative way. Let us see some of  the ways to generate DB Sequence for PK.

Override the Create Method in EmployeesEOImpl class

public void create(AttributeList attributeList) { 

super.create(attributeList); 

//this is the code 

SequenceImpl seq = new SequenceImpl("EMP_SEQUENCE", getDBTransaction()); 

Number seqNextval = seq.getSequenceNumber(); 

setEmployeeId(seqNextval); }

Overriding initDefaults() in StudentEOImpl class

protected void initDefaults() { 

super.initDefaults(); 

SequenceImpl seq = new SequenceImpl("STUDENT_BASIC_INFO_SEQ", 

getDBTransaction()); populateAttributeAsChanged(STUDENTID,seq.getSequenceNumber().toString()); 

}

Note: If  u didn’t get how to go in to the initDefaults() or Create() methods ,go to source menu in the menu-bar --à override methods & select the above methods

Declarative way

Go to Employee attribute section & double click on EmpId . Edit Attribute dialog will appear, Select value type is expression. In the value Field write the below expression 

(new oracle.jbo.server.SequenceImpl("EMP_SEQUENCE",adf.object.getDBTransaction())) .getSequenceNumber()

Declarative way using Trigger

Trigger helps to retain the sequence even after rollback operation is done . Generate a Trigger on your table as below

generating-sequence-number-primary-key-oracle-adf

using-trigger-oracle-adf

In the entity attribute section for DeptID , select below properties Type=DBSequence Updatable=Never Refresh After=Update

dbsequence


Read More

Customizing Business Rules in Oracle ADF

Customizing Business Rules in Oracle ADF

Customizing Business Rules in ADF: In Oracle ADF, Business rules are customized  mostly at entity level because the entity object  definition performs DML operations like INSERT, UPDATE, DELETE We can customize business rules or any validations on attribute & row level by extending a class from oracle.jbo.server.EntityImpl

for example If u want to customize a attribute of an Entity Object. Then it has to be done in the respective EOimpl class which extends Entity object class (oracle.jbo.server.EntityImpl)

Customizing Business Rules in Oracle ADF

Here i  want to set an attribute value to be displayed in uppercase. change the getter method as follows.

customizing-business-rules-in-oracle-adf

The extended class contains type safe getters & setters for each attribute like getFirstName, setFirstName etc... 

Typesafe getters and setters are ideal places to put attribute-level business rules, such as validation logic. 

They contain calls to the methods EntityImpl.getAttributeInternal() and EntityImpl.setAttributeInternal() respectively, and by wrapping that call in additional code (such as an if-then block), you can place conditions on attribute change or access, or enforce logic before or after the attribute is accessed or changed.

For more information : Implementing Business Rules

Read More

What Are Oracle ADF Data Control, Binding Context, Container?

What Are Oracle ADF Data Control, Binding Context, Container?

Data Control/DataControls.dcx: A data control is essentially a bridge that makes data from a source available to the user interface in an ADF Fusion Web Application. You can use the objects in the data control to create databound user interface components, but not directly.

What Are Oracle ADF Data Control, Binding Context, Container?

adf-datacontrol-binding-context-binding-container

It identifies the Oracle ADF model layer data control classes(factory classes) that facilitate the interaction between the client and the available business service. This type of data control is generated by JDeveloper when you create an application module in your ADF Business Components application. 

Typically, there is one data control for a given source (bean, EJB, or URL). However, you may have additional data controls that were created for other types of objects (for example, application modules or web services).

Note: DataControl.dcx is registry of DataControls. DataControl.dcx  is not created for ADF Business Componets. This File is created when tou register Datacontrol on technologies  other than ADFBC

Binding Context/ DataBindings.cpx

Binding context is a runtime map between the data controls and page definition of pages in the application which is used to access the binding layer. It is accessible through the EL expression in your jspx pages. At runtime, the interaction with the business services initiated from the client or controller is managed by the application through a single object known as the Oracle ADF model binding context.

Note: DataBindings.cpx is registry of Page definition files It is a metadata file contains ADF Binding Context for the entire Application.

Binding container/Page Definition

It  is a request-scoped map that is used to instantiate the page bindings. This is accessible through the EL expressions. Also, since it is request-scoped map, it is accessible during every page request. Each JSF page has its own Page Definition  and it contains Bindings, Executables(Iterators) and Datacontrol mapping. Note: Where Iterators are used to access the Binding Context of that particular page.

Read More

Oracle XE service instance failed Status Error?

Oracle XE service instance failed Status Error?

Oracle XE service instance failed: While installing Oracle XE database into Windows operating system sometimes we might face below error message. Checking for Oracle XE service instance: failed Actual Reason: Actually, we face this failed message because we haven't done Uninstalling of previously installed XE completely. when we tried to install for the second time we will be facing this failed message. So first we have to clear those registries.

oracle-xe-service-instance-failed-error-status

How To Solve Oracle XE service instance failed Status Error?

Now open cmd prompt using admin rights and change the existing user path to system32. 

cd C:\windows\system32 

Now use the command sc delete OracleServiceXE 

Now we can see a success message after deleting those registries.

oracle-xe-service-instance-failed-error-status-rectify
Read More