留言板

Information on Liferay and Liferay DB

Guru patil,修改在10 年前。

Information on Liferay and Liferay DB

Regular Member 帖子: 163 加入日期: 13-4-19 最近的帖子
Hi All,


I want the information on the Liferay, If I do some operations which tables are getting updated or values are getting inserted

At least there is any documentation on the Database tables. I want to know what is the purpose of each table in liferay,

Is there any documentation on this.

Any help or link or doc will be help full.
Hope positive results.


Thanks
thumbnail
David H Nebinger,修改在10 年前。

RE: Information on Liferay and Liferay DB

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
This is not available. You should not be in the database at all.

Like any other commercial package, Liferay uses a database but it should be considered a 'black box'. It is their resource, not yours to muck around with.

The only thing you should be using is the Liferay API. That is the only place you should be in to access, modify, or delete data. The internals of the API are subject to change in every new release. Only the API will ensure data integrity.
thumbnail
dave ch,修改在10 年前。

RE: Information on Liferay and Liferay DB

Regular Member 帖子: 161 加入日期: 12-2-7 最近的帖子
Hi Guru,
Once you complete your LR setup with your DB you can see all the tables in your DB.
About any updated tables, its basically depends upon your type of operation. Once you start using liferay (plugins) slowly you will come to know about where your values are getting updated.

Regards
thumbnail
Mika Koivisto,修改在10 年前。

RE: Information on Liferay and Liferay DB

Liferay Legend 帖子: 1519 加入日期: 06-8-7 最近的帖子
Don't mess with the database. Use the API.
Guru patil,修改在10 年前。

RE: Information on Liferay and Liferay DB

Regular Member 帖子: 163 加入日期: 13-4-19 最近的帖子
Hi All,

Thanks for suggestion.

I just wanted to know the information on the database tables.
What is purpose of each table and how they are inter-related.

For example user information is stored in user_table.

So am just searching for these kind of simple data.
thumbnail
Manish Yadav,修改在10 年前。

RE: Information on Liferay and Liferay DB

Expert 帖子: 493 加入日期: 12-5-26 最近的帖子
Guru patil:
Hi All,

Thanks for suggestion.

I just wanted to know the information on the database tables.
What is purpose of each table and how they are inter-related.

For example user information is stored in user_table.

So am just searching for these kind of simple data.


Hi Guru, David and Mika want to advise you try to learn about LR API instead to DB tables for eg:- if you want to delete any user from LR then you should you UserLocalServiceUtil.deleteUser() method instead of SQL delete query because User_ table is mapped with other tables(Primary and foreign key relationship)

Thanks & Regards
Manish Yadav
eresh k,修改在10 年前。

RE: Information on Liferay and Liferay DB

Junior Member 帖子: 26 加入日期: 13-6-17 最近的帖子
Hi Guru,

If you are using the Liferay from quite a long time and as per the experience, you can came to know which tables are used in Liferay for which purposes.
For Example Organisation data is saved in organisation_ table.
etc

So as you keep on exploring the liferay you can easily find out the purpose of each table.
thumbnail
David H Nebinger,修改在10 年前。

RE: Information on Liferay and Liferay DB

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
eresh k:
If you are using the Liferay from quite a long time and as per the experience, you can came to know which tables are used in Liferay for which purposes.
For Example Organisation data is saved in organisation_ table.


And if you really had used Liferay for a long time, you'd know that Eresh's statement is only valid for the current version of Liferay that you're using. You'd know that Liferay will deprecate or repurpose tables/columns with each release. You'd know that during the upgrade process existing data may be changed/coerced to conform to the new API, and you'd also know that the API is the only way to correctly perform CRUD operations against the database.

Do yourselves a favor and just stay out of the database altogether.
thumbnail
James Falkner,修改在10 年前。

RE: Information on Liferay and Liferay DB

Liferay Legend 帖子: 1399 加入日期: 10-9-17 最近的帖子
David H Nebinger:

Do yourselves a favor and just stay out of the database altogether.


I'd just like to pile on with additional dangers - a lot of data is cached "above" the database, so making changes to the DB directly is likely going to cause problems, because those upper level caches aren't expecting you to do that, and won't invalidate their caches, leading to incorrect results all over the place.
thumbnail
Olaf Kock,修改在10 年前。

RE: Information on Liferay and Liferay DB

Liferay Legend 帖子: 6403 加入日期: 08-9-23 最近的帖子
...and, adding more arguments: If you add new entries to the database, you might trigger "duplicate primary key" errors. The tricky part of those is that they can appear *months* after the change - e.g. today you're in need of an unused primary key and choose one. In 6 months, that key will be used by Liferay, not knowing that you have done so manually. Liferay's API operation will fail then and you will have long forgotten that you have manually inserted some data, causing this issue.

Not to mention that Liferay relies on various foreign key relationships that are not obvious and that you will miss. Even documenting them will not help you, because the requirements for those foreign keys will change over time without notice. All update routines assume that certain data is there - if you missed it manually, updates might fail in any way. The API does it right. Use that!
Guru patil,修改在10 年前。

RE: Information on Liferay and Liferay DB

Regular Member 帖子: 163 加入日期: 13-4-19 最近的帖子
Thanks every body for fruitful information,

I will use the liferay API for the reference.

But David referred to stay out of database its bit confusing.
As database as database is the main thing involved in any application and its like heart of any application.
So database need to be understood if we want some in-depth information.
thumbnail
David H Nebinger,修改在10 年前。

RE: Information on Liferay and Liferay DB

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
Guru patil:
As database is the main thing involved in any application and its like heart of any application. So database need to be understood if we want some in-depth information.


In Liferay, the API is the heart of the application. The API needs to be understood if you want some in-depth information.

The database itself can be rather confusing. It is highly normalized, and many key columns can be keys to many different tables; they're not foreign keys as defined by the relational model. It's also undocumented, and changes with every new release.

And for Liferay, the database is only 'part' of the heart. There's caching, there's indexing, there's filesystem stores, etc. The database, in itself, does not provide a complete picture that you may get from other applications.

The API is the only thing that will give you the complete picture...
thumbnail
Jack Bakker,修改在10 年前。

RE: Information on Liferay and Liferay DB

Liferay Master 帖子: 978 加入日期: 10-1-3 最近的帖子
learning about the database and api is very educational ; however like with most more sophisticated software, best not to change data in the db directly given dependencies (I think that is what David meant)
Guru patil,修改在10 年前。

RE: Information on Liferay and Liferay DB

Regular Member 帖子: 163 加入日期: 13-4-19 最近的帖子
Now i can agree with David.

Thanks David and Jack for clarifying the things.emoticon