Liferay 及其数据库模型
我们想要使用 Liferay,但是是否可以使用外键和完整性创建我们自己的数据库表?
Liferay 似乎创建了很多东西并且可以控制数据库,所以我想知道我们在尝试这样做时是否会遇到问题。
谢谢你!
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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当然可以。您将花费大部分时间来开发 portlet 和插件,它们有自己的数据库模型(在同一数据库中),独立于门户数据库模型。
您可以选择使用所谓的 Service Builder,它是一个源代码生成器,除其他外,它还可以根据元数据定义创建数据模型的 DDL 脚本。同样,即使这个数据模型也不依赖于 Portal 数据库,而是基于 Hibernate/JPA。
另一种选择是根本不使用 Service Builder,而直接使用一些 JPA 实现或 Hibernate。
有时,人们只需要使用门户表(用户、资源等)并将数据保存到其中,但为此您已经有一个可用的服务层。
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.
Liferay 架构中没有外键,您无法与 Liferay 服务构建器创建外键关系。
请参阅外键在哪里?
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?