I am new to liferay, Can anyone please suggest some way to generate the service.xml for existing database Discussion on Liferay Website . I hope people might have developed some way or liferay have developed some plugin for this.
相关问题
- Is it possible in Liferay to add custom Resource-A
- Display data from Custom Query(Joined tables) in l
- how can we remove that Liferay Logo , Sign In Hype
- How to get Server Name and Server Port from Lifera
- Error in calling CMIS Query if String contains sin
相关文章
- How to create a Liferay 7 structure programmatical
- How to migrate Liferay portal from one windows mac
- How do I get Sites of which the user is a member i
- Current URL /web/guest/HTML generates exception: n
-
Primefaces
doesn't work
- Liferay 7 not able to set the global session attri
- Liferay concatenate and compress javascript
- Liferay Portlet: How to generate service.xml (serv
Not done yet AFAIK. Since Liferay directly doesnot support all data properties of DB like foreign key, one to n mapping etc, it is a challenge to create the reverese engineering. But you can give a try.
I see no particular use in introducing servicebuilder to large existing databases: You can connect servicebuilder entities to "legacy datasources" or "legacy tables" (those make good search terms) but service.xml generation has not been done AFAIK.
Some problem with this approach are:
My recommendation is to rather have a proper interface on the existing business logic, e.g. Webservice, JSON, Rest, whatever is popular. Then use this interface in Liferay's portlets.
Another option might be to bring the existing persistence code into Liferay and just expose services without making use of the persistence features of Servicebuilder. For this you'd just define empty
<entity>
blocks (with names etc). This will generate the appropriateDoSomethingLocalService
, but omit the persistence implementation - and you can wire your existing code in these services.Service Builder is generally a nice feature to create relatively small databases, and simple business Logic, while giving you the advantage that your tables will be auto-generated when you deploy your portlet, and having finders (search by X attribute) with no effort. If this is the case with your database, it will be much easier to create a new service.xml from scratch.
Other that that, I think that having an extended database in Liferay's Service Builder will introduce more problems and slow development while you're implementing a complex business Logic, create custom Finders whenever you need to query on a join of tables and so on. So it seems quite normal to me that a conversion of a database to Service Builder is not available.
In other words, if your database is too large to write it in service.xml, you shouldn't use Service Builder in the first place
You can go through below link to understand Service Builder in liferay
https://www.liferay.com/documentation/liferay-portal/6.0/development/-/ai/service-build-2
Also below link have sample service builder portlet
https://www.liferay.com/community/forums/-/message_boards/message/17609606
Hope it Helps !