Fórum

DB Diagram ?

thumbnail
petar banicevic, modificado 8 Anos atrás.

DB Diagram ?

Junior Member Postagens: 73 Data de Entrada: 27/05/08 Postagens Recentes
Hello,

Is there any document or wiki page where I can see db diagram with tables and their relationship ?

Thanks.
thumbnail
David H Nebinger, modificado 8 Anos atrás.

RE: DB Diagram ?

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
No, and you shouldn't be looking.

The database is not yours. The tables are not yours. The relations are not yours. So don't look at them.

The API is yours. It's the only approved way of performing CRUD operations on the Liferay data.

But stay out of the database.
thumbnail
petar banicevic, modificado 8 Anos atrás.

RE: DB Diagram ?

Junior Member Postagens: 73 Data de Entrada: 27/05/08 Postagens Recentes
Dear,

It would help me when using the API e.g. to know that account object can give me reference to the contact object. See, everyone has it's own way of working and learning - so when you use words "should not be using/needing" sounds pretty harsh for a simple question - unless there is some legal restriction.

Please if your answer doesn't provide focused answer to the question - then please don't provide one - now people will think you helped me (resolved the question). And you put your effort of typing which is also pity for you.

Regards.,

PS: Plz don't give me some "junior" treatment, I am not here often as we usually use enterprise support. This was simple question, no need for ticket.
thumbnail
David H Nebinger, modificado 8 Anos atrás.

RE: DB Diagram ?

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
It's not anything like that, it's that you cannot rely on the database model.

Liferay changes the data model on every release so what you think you know in this version may not work in the next.

Also the database has changed over time, there can be deprecated columns in there and columns used for a different purpose than what the column name implies.

And the data model is not going to reflect relationships at all. Take the Asset table for example. In Liferay, most entities are assets. The Asset table therefore points to a slew of other Liferay tables indirectly. The relationship cannot be modeled, but the class name and class pk columns are used to determine what table is being referred to and what record is mapped. Because the Asset table is so generic, some columns will apply to one type of asset but have no meaning to another type of asset.

The whole database is structured like that. Generic tables, no foreign keys and code-enforced relationships and requirements.

Trust me, I know as a developer I too want a data model so I can understand the overall relationship of the entities before diving into the code. But I'm also telling you from experience that you will not be able to glean this type of knowledge from the Liferay database.

Instead rely on just the API - the XxxLocalServiceUtil classes give you the methods for CRUD operations and the model objects themselves give you the relationships to other entities that they have.

The generic data model is not going to show you that kind of thing.

This is not meant to sound harsh, honestly, it is a fact that comes out of experience with Liferay.
thumbnail
Olaf Kock, modificado 8 Anos atrás.

RE: DB Diagram ?

Liferay Legend Postagens: 6403 Data de Entrada: 23/09/08 Postagens Recentes
Let me chime in with David. We've seen too many problems with people that claimed to understand the data model, then attempted to write to the database (inevitably, the temptation will be there). And quite a few times this led to disaster. If only to save you from this experience later on, you're better of not looking at the database.

There's nothing wrong with occasionally looking at some data, but you should always be aware that the total structure is typically not well understood, for precisely the reason that David gave (and gives in the additional answer). While you might be the one exception, a lot of people have made bad experience in conjunction with claiming to understand the database. And in the very sneaky cases, the problems manifest a year after a modification, when it's long forgotten that someone wrote to the database. Been there, done that.

This is basically the standard answer that you get for this request. Sorry, I'd like to come up with something different. However, it's also what I'm living myself.
thumbnail
petar banicevic, modificado 8 Anos atrás.

RE: DB Diagram ?

Junior Member Postagens: 73 Data de Entrada: 27/05/08 Postagens Recentes
Hi,

I understand your point of view. Then I will have to look for some spring diagrams instead.

It's hard to remember all functions and groups... ; and in the design phase, when doing sequence diagrams, referring to the underlying existing functionality is part of the day to day job.

Thanks
P
thumbnail
David H Nebinger, modificado 8 Anos atrás.

RE: DB Diagram ?

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
Yep, I've been doing Liferay a long time and I don't remember all of the functions/groups either. emoticon

I'm not sure you're going to have any luck with the spring diagrams either. I think there's a mix of xml and annotations in play so you may not get a complete picture that way either emoticon
thumbnail
Richard Sezov, modificado 8 Anos atrás.

RE: DB Diagram ?

Regular Member Postagens: 220 Data de Entrada: 07/02/07 Postagens Recentes
I'm going to chime in here and let you in on a little secret.

Liferay Developer Studio has a way to look at Service Builder XML files and generate a database diagram from them. This means that theoretically, you could grab Liferay's source code, open it in Dev Studio, and load the service builder XML files into Dev Studio to generate diagrams that might be helpful.

Notice that I said words like theoretically and might. All the caveats that my colleagues brought up apply. emoticon
thumbnail
petar banicevic, modificado 6 Anos atrás.

RE: DB Diagram ?

Junior Member Postagens: 73 Data de Entrada: 27/05/08 Postagens Recentes
Hi Richard,

This is obsolete topic, but hey, it can be like a time capsule; someone will find it useful one day emoticon

Regarding spring XMLs, lots of IDEs use Spring plugin to show bean inter-relations.
None of tools/plugins that I am aware of, can handle spring annotations and draw some diagram with bean inter-relations.

So, if ever you find out some kind of Poster with Liferay spring groups and functions, please share it with everyone. Product is getting huge and we need some roadmap and groups of functions.

Best of luck,
P.