Jatin
Jatin

Reputation: 31744

Using Liferay DB through Hibernate or JDBC

What is the impact of using Hibernate to connect to Liferay DB Schema? or What if we use seperate JDBC (can even be Spring JDBC) to connect to custom portlet's application DB Schema?

Also, if we can do it, how to go about it?

Upvotes: 2

Views: 1568

Answers (1)

Prakash K
Prakash K

Reputation: 11698

By default hibernate is used to connect to Liferay. And if you use hibernate then you get all the benefit of using ... well Hibernate API :-) which gives you Transaction support and a rich API to generate database agnostic sql queries and more.

For your custom plugin portlet you can also use Liferay's Service Builder, which is nothing but a wrapper around Hibernate and Spring and provides a lot of auto-generated code.

But still if you want to go the other way, then you can use JDBC (or Spring JDBC) the same way for your custom plugin portlet as you do with any other web-application. The configuration remains the same.

Upvotes: 3

Related Questions