Skip to main content

Oracle ADF Business Components (ADF BC)

Q:What are Entity Objects?
A: Entity objects are Data Access Objects (DAOs) that are responsible for persisting & caching data, validation, and encapsulating business rules.
·  Represent a database table or other data source.
·  Handles database caching.
·  Contains attributes representing the database columns.
·  Encapsulates attribute-level and entity –level validation logic.
·  Can contain custom business methods.

Q : Can an entity object be based on two Database Objects(tables/views) or two Webservices?
A : No, Directly its not possible to create EO using multiple tables.
   Entity objects will always have one to one relationship with a database object or web service.

Q.What is Control Hints in Entity Object configuration?
A: Control hints are associated with the current view or entity attribute. All view objects inherit the hint values at run time.
Control hints for data controls and bindings, including: Labels, Date & currency formatting.

Q.What are View Objects?
A: View objects, which can be bases on entity objects/Web Services, represent the data which you want to view and manipulate.
·  Present a view or slice of business data.
·  Are used for joining, filtering, projecting, and sorting your business data.
·  Can be based on any number of entity objects.
·  Can also be constructed from a SQL statement.
Read-only SQL –Based View Objects:
·  Is not based on any entity based object.
·  Cannot be used for insert, update, or delete.
.  Use SQL-based view objects for query –only views, which do not need the functionality of entity objects.

Q.What is Application Module?
A: An ADF components application module is a service object that coordinates view objects for a specific task in the same way that a form usually encapsulates a single user task. It contains only the business services that the application requires, and can be compared to a Forms module.
An application module can represent and assist with tasks such as:
·  Updating customer information
·  Creating new order
·  Processing salary increases.

Q: Can we change DB connection for any particular AM?
A: YES, follow steps to change DB connection:
1. Double click on AM.
2. GO to the configuration tab, click on configuration file bc4j.xml
3. Here we have attribute JDBCName under element AppModuleConfig, change the connection which is created for other DB.

Q.What is view link? How to create it? What is idea behind it?
A: View Link is an active link between view objects.You can create view links by providing the Source & destination VO attributes.
Oracle ADF view links are business components that define a relationship between two Oracle ADF view object definitions (the "source" and "destination" view objects) based on sets of view attributes (the "source" and "destination" attributes) from each.
These can range from simple one-to-many relationships to complex many-to-many relationships. This allows you to easily create master/detail relationships between data controls in the client. For example, creating a view link between view objects will allow you to create relationships between:
A dropdown list for selecting a customer and a table displaying that customer's orders
The nodes in a tree control and their respective children
An HTML page containing two frames: one that allows the user to browse for items and the other that lists the wherehouses in which the selected item is stored
View Links can be created using:
1.    Two View objects
2.    Based on EO Association

View Links and Queries
A view link definition relates two view object definitions. In the vast majority of cases, the view object definitions will contain SQL queries that access a database, and the view link definition will relate those queries using a parametrized WHERE clause, which is appended to the destination view object's query and resolved using the values of source attributes.

Q: How many types of VOs we can create in Oracle ADF?

A: There are four types of VOs we can create as shown in below image, select radio button & create VO.

1. Updatable VO (Updatable access through entity objects) - Here EO need to be created for  updatable VOs.
2. Read only VO (Read-only access through SQl query) - No need to create EO, VOs can be created using SQL queries, table, or views.
3. Rows populated pro-grammatically, not based on query - This is also read-only view. Here add one or more attributes to use in program. In the Attribute Settings page, adjust any setting you may need to for the attributes you defined.
4. Static VO (Rows populated at design time- Static List): You use the Create View Object wizard to create static view objects. The wizard lets you define the desired attributes (columns) and enter as many rows of data as necessary. The wizard displays the static data table as you create it.




Comments

Popular posts from this blog

Passivation and Activation in ADF (Application Module )

1. For performance reasons, ADF keeps a pool of application modules in memory. It tries to give each session the same application module as the session used during the last request; however, this might not be possible during peak load of your application. 2. In this case, ADF saves the application modules state in a database table so the application module can be used by another session. This is called passivation . 3. When the first session needs the application module again, its state is retrieved from the database process known as activation . 4. If you have made an error in your code and depend on some variable that is not persisted correctly when your application module state is stored, you will experience mysterious errors under high load.   Enable/Disable Application Module Pooling : Right-click on your application module, choose Configurations.By default, each application module has two configurations. Ensure that the one ending in …Local is selected and then click

Get modified rows from Entitiy Cache

To get the modified rows from entity cache we have getEntityState() method at EntityImpl class. Refer to my previous blog  Accessing EO impl methods from VO impl  where i am overriding the getEntityState() in EOimpl and calling it in VOImpl. We can use methods written or overridden in VOImpl class to AMImpl class. There are different states associated with an entity object. STATUS_UNMODIFIED STATUS_MODIFIED STATUS_NEW STATUS_DELETED STATUS_DEAD We have to check the state or row in our AmImpl class by using the VOImpl method and through this we can distinguish the rows present at vo. Add below code in AMImpl class along with my previous post. public void geCachedRowsCount(){         JobsVOImpl jobsVo = (JobsVOImpl)this.getJobsVO();         RowSetIterator iter = jobsVo.createRowSetIterator(null);             while(iter.hasNext()){             Row row = iter.next();             byte state = jobsVo.getEntityState(row);             System.out.println("Job_id -&

The file store "WLS_DIAGNOSTICS" could not be opened

WLS_DIAGNOSTIC ERROR weblogic.store.PersistentStoreException: [Store:280073]The file store "WLS_DIAGNOSTICS" could not be opened because it contained a file with the invalid version 1. A file of version 2 was expected. When you get this error while running your application on internal weblogic server delete the following file WLS_DIAGNOSTICS000000.DAT search the file in following path C:\jdev_work\system11.1.1.5.37.60.13\DefaultDomain this file is in DefaultDomain folder of your jdev. and delete the WLS_DIAGNOSTICS000000.DAT file . and run your applicatuon