Posts

Showing posts with the label POJO

Programmatic DVT charts in Oracle ADF

Image
JDev: 12.2.1.3.0 Source:  GitHub This article talks about programmatic approach of creating dvt components or charts, using Java objects, and more importantly, without ADF bindings. This is quite helpful when you deal with data which does not change often and can be pre-loaded into Java objects. The biggest advantage of this is of course, performance , since you do away with any database interaction. The sample code has a table based on Department pojo. Each department object has a List of Employee pojo. On table row selection, I retrieve the list of employees, and I use this list to create the Object array required for each chart type. There are a couple of key points to this approach: 1) Your Java data model should be prepared to provide all the required information to the chart. 2) You need to know the "Tabular Data"  format for each graph. My data-model consists of a Department object, having a list of Employee objects. Each graph's tabular...

Pass custom objects across ADF taskflows (by value or reference)

Image
JDev: 12.2.1.3.0 Source:  GitHub We usually pass along parameters of native data types across ADF task-flow calls. We set up input and output parameters for the source and target task-flows, and we access the variables from the pageFlowScope map. Absolutely nothing wrong with this approach. But how about a scenario where we process and populate a POJO variable from the source task-flow, and expect a POJO variable on the target task-flow to be populated via a declarative route? The Parameters section of a bounded task-flow allows you to set a specific property on its managed bean to which the object being passed across will be assigned. While passing along an object across task-flows, ADF lets you choose whether you want to pass the object by value or by reference. Let us examine the difference between the two approaches. This is what we want to achieve: Initialize an Employee variable (employeeInTarget) in the source task-flow and pass this variabl...

Complex datatypes for ADF AM/VO client service methods

Image
JDev: 12.2.1.3.0 Source:  GitHub One very recent work-related requirement was to pass and return complex data types from an Application Module Implementation class method. For those of us who are familiar with this concept, we know that we usually pass around native Java data-types, like String, Integer, Boolean, etc, or maybe List, Map. But what if we need to pass and return a complex POJO - such as an Employees object (as shown below)? You might have also noticed that we are able to pass and return oracle.jbo.Row objects. But JDev does not allow us to create a service method if we want to return a view object's implementation class, such as EmployeesVORowImpl . The reason that AM client service implementation allows certain data-types is that those data-types are available to both Model and ViewController projects. If you open up Model or ViewController project properties and search for oracle.jbo.Row class, you will find that it is include...