Skip to main content

Posts

Showing posts from 2016

ADF Business Components Data Types

ADF Business Components is compatible with the built-in data types the Java language provides, including strings, dates, and numeric data. In addition to these Java data types, the oracle.jbo.domain and oracle.ord.im packages of ADF Business Components provides types that are optimized for the Oracle database.

IN clause in adf view criteria

You can use below programmatic approach to solve this problem.Create a view criteria progarametically and set attribute value as bind variable.                          ViewObjectImpl view = this.getNsSentenceGroupVO();                 ViewCriteria vc = view.createViewCriteria();             vc.setName("INCriteria");             String inClause = "IN "+groupNames;             ViewCriteriaRow criteriaRow = vc.createViewCriteriaRow();             criteriaRow.setAttribute(" GroupName", inClause);             vc.addElement(criteriaRow);             view.applyViewCriteria(vc, true);             view.executeQuery();             System.out.println(view. getEstimatedRowCount()); This groupNames is coming from below method. It will iterate a ArrayList and give u a single string with well formatted query as string.     public void loadRemovalGroups(){         //getGroupsForRemove         String groups="(";        

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 -&

Accessing EOImpl methods from VOImpl

When you have a requirement to access EOImpl level overridden methods or any custom method from VOImpl follow below steps. 1.Create/Override method in your EOImpl class In above example i have overridden the getEntityState method to print the state of my current entity row. 2. To access this method in VOImpl class Create VOImpl and VORowImpl classes for your view object. See the code written in below VOImpl class to access the EOImpl methods. 3. Now you can expose this method to client tier through VO/AM Client Interface. As per your requirement you can use the client interface and achieve the functionality.

Customize ADF Entity Object

Like most business components, individual entity objects are partially defined by XML files. These files specify: 1. Simple metadata about the datasource, such as the table name and attribute definitions and 2. Simple business logic, such as the business logic that represents most column constraints and simple validation and security logic. In addition to XML files, entity object definitions comprise up to three Java classes: a) The entity object class - an instance of this class (an entity object instance) represents a single row from the datasource ( oracle.jbo.server.EntityImpl ) b) The entity collection class - an instance of this class represents the collection of rows currently in memory for a single user( oracle.jbo.server.EntityCache ) c) The entity definition class - the singleton instance of this class represents the entire datasource object( oracle.jbo.server.EntityDefImpl ) To access an entity row, you use a related object called the entity definition. At run

Localization/Internationalization in oracle adf

Internationalization and Localization are means of adapting aplication to different languages, regional differences and technical requirements of a target market. Internationalization is the process of designing a software application so that it can potentially be adapted to various languages and regions without engineering changes. Localization is the process of adapting internationalized software for aspecific region or language by adding locale-specific components and translating text. Follow below steps for doing localization. 1. Create .properties files as per the locales required in your application. For demo purpose i created german and english locale properties file, one main file is required which will congtain all labelsSo total 3 properties files are there. For property file creation ViewController->New->General->File InterBundle.properties file is the main properties file and for the same labels 2 different files are created one is for english and a