Atul
Atul

Reputation: 1590

Oracle ADF Integration with Hibernate

I have been learning Oracle ADF for the past one week. I have got basic grasp over ADF now. (EO , VO , Application Module and JSF Views)

Now I want to understand how ADF can be used with other frameworks , mainly Spring and Hibernate.

This tutorial explains Spring and ADF integration.

I am looking for same for Hibernate also. But I am not finding any good resource for the same.

Primary thing I am searching is , can we read data from Hiberbate /JPA entities into ADF view objects ? Without using EO objects which are primary source of data for ADF fusion application ?

I have seen tutorials similar like this, but these use EJB as an interface to access JPA entities.

Is there any mechanism available apart from this to access JPA entities from ADF ?

Please advice.

Upvotes: 0

Views: 761

Answers (1)

Joe
Joe

Reputation: 3347

First of all, “ADF” is actually 3 parts: ADF BC is the ORM / data layer. ADF Faces is the view layer that creates and presents server generated JSF pages to the web browser/user. ADF Model is the data binding layer that reads/writes the data from the ORM / data layer to the JSF pages via drag/drop and generated code.

One does not typically mix ORM solutions as a matter of course. We typically use ADF BC or JPA or Hibernate, then create a data control based on the ORM objects abd use these data controls to move data onto and off of the ADF Faces page.

ADF BC is designed to be its own ORM. One does not usually combine ORMs like JPA or Hibernate with ADF BC...What would be the point? ADF BC is intended as a different solution to the ORM problem and has better features and tooling support in JDeveloper than JPA. If you absolutely must use hibernate as the java layer to read/write to your DB, and you absolutely must have EOs and VOs that use the Hibernate java classes (again...Why???) then you will need to create custom, hand-coded programmatic based-VOs and use the VO API to get data into them from the Hibernate classes. This can work. But what about Writes? Are you going to extend and customize the EOs as well?

EJBs is the way JPA works... it’s part of the reference implementation of JEE via eclipse link...go look it up. Why not use ejbs?

To access Hibernate based classes w/using the JPA-generated EJBs and automatic tooling built into Jdeveloper, you can create your own hand-coded, custom java classes to read/write the Hibernate classes, then create ADF data controls based on those java beans- your custom hand coded classes to access the Hibernate classes. Then use the Data Controls as intended with ADF faces. That’s a lot of Manual work...why bother? Why bypass the automatic class generation, ejbs generation and data control generation...and maintenance of same that is built into JDeveloper specifically to avoid the tedious manual path you seem intent to follow.

If this is just a learning exercise fine...but it’s not really scalable or suitable for production.

Upvotes: 1

Related Questions