tink01
tink01

Reputation: 347

Liferay and its database model

We want to use Liferay but is it possible to create our own database tables with foreign keys and integrity?

Liferay seems to create a lot of stuff and has control over the DB, so I want to know if we'll get into problems trying to do this.

thank you!

Upvotes: 2

Views: 5568

Answers (2)

blank
blank

Reputation: 18170

There are no foreign keys in the liferay schema and you can't create foreign key relationships with the Liferay service builder.

See Where are the foreign keys?

Upvotes: 2

lisak
lisak

Reputation: 21981

Of course you can. You will spend most of the time developing portlets and plugins, that have their own database model (in the same database) that is independent of the portal database model.

You have a choice to use so called Service Builder, which is a source code generator that among other things creates DDL scripts of your data model based on metadata definition. Again, even this data model doesn't depend on Portal database and is based on Hibernate/JPA.

Another choice is to not use Service Builder at all and utilize some JPA implementation or Hibernate directly.

Sometimes one just needs to use portal tables (User, Resources, etc.) and persist data into them but for that you have a service layer already available for you.

Upvotes: 5

Related Questions