In ADF, for creating Business services related to DB we generally use ADF – BC (EO, VO, AM), but we can also use JPA(Java Persistence API) Entities. Which option to choose is completely your choice as there won’t be any difference if you create data controls out of them in terms of performance. But you can note few points that ADF-BC provides default List of Values and validations options. If you are familiar with using Hibernate (But not with ADF-BC) then you are good to go with using JPA Entities.

JPA Entity:


You can find the below sample JPA entity created for Departments table.

package model;


import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;

@NamedQueries({ @NamedQuery(name = "Departments.findAll", query = "select o from Departments o") })
public class Departments implements Serializable {
private static final long serialVersionUID = -1771169464233198257L;

@Column(name = "DEPARTMENT_ID", nullable = false)
private Integer departmentId;

@Column(name = "DEPARTMENT_NAME", nullable = false, length = 30)
private String departmentName;

@Column(name = "LOCATION_ID")
private Integer locationId;

@JoinColumn(name = "MANAGER_ID")
private Employees employees1;

@OneToMany(mappedBy = "departments", cascade = { CascadeType.PERSIST, CascadeType.MERGE })
private List<Employees> employeesList1;

public Departments() {

public Departments(Integer departmentId, String departmentName, Integer locationId, Employees employees1) {
this.departmentId = departmentId;
this.departmentName = departmentName;
this.locationId = locationId;
this.employees1 = employees1;

public Integer getDepartmentId() {
return departmentId;

public void setDepartmentId(Integer departmentId) {
this.departmentId = departmentId;

public String getDepartmentName() {
return departmentName;

public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;

public Integer getLocationId() {
return locationId;

public void setLocationId(Integer locationId) {
this.locationId = locationId;


public Employees getEmployees1() {
return employees1;

public void setEmployees1(Employees employees1) {
this.employees1 = employees1;

public List<Employees> getEmployeesList1() {
return employeesList1;

public void setEmployeesList1(List<Employees> employeesList1) {
this.employeesList1 = employeesList1;

public Employees addEmployees(Employees employees) {
return employees;

public Employees removeEmployees(Employees employees) {
return employees;