Foros de discusión
ServiceBuilder - mapping-key problem
Peter Ruzicka, modificado hace 14 años.
ServiceBuilder - mapping-key problem
Junior Member Mensajes: 48 Fecha de incorporación: 7/12/06 Mensajes recientes
Hello,
I have problem with ServiceBuilder 5.2.3 SDK with one-to-may relationship. I saw many error reports in this forum, but mostly for SQL query related problems.
This is only example to explain - one book has one writer and one reviewer. Writer and reviewer are simply Users.
I would like to see generated methods for one-to-many relationship getWrittenBooks(..) getReviewedBooks(..) ... but there are generated TWO methods with name getBooks(..).
Methods should be generated based on "name" attribute and not entity one.
Is this a new bug or ? I can not believe that nobody needed this feature.
Thank you
Peter
I have problem with ServiceBuilder 5.2.3 SDK with one-to-may relationship. I saw many error reports in this forum, but mostly for SQL query related problems.
This is only example to explain - one book has one writer and one reviewer. Writer and reviewer are simply Users.
<namespace>Library</namespace>
<entity name="Book" local-service="true" remote-service="false">
<!-- PK fields -->
<column name="bookId" type="long" primary="true" />
<column name="title" type="String" />
<column name="writerId" type="long" />
<column name="reviewerId" type="long" />
</entity>
<entity name="User" local-service="true" remote-service="false">
<!-- PK fields -->
<column name="userId" type="long" primary="true" />
<column name="writtenBooks" type="Collection" entity="Book" mapping-key="writerId" />
<column name="reviewedBooks" type="Collection" entity="Book" mapping-key="reviewerId" />
<column name="userName" type="String" />
</entity>
I would like to see generated methods for one-to-many relationship getWrittenBooks(..) getReviewedBooks(..) ... but there are generated TWO methods with name getBooks(..).
Methods should be generated based on "name" attribute and not entity one.
[javac] D:\workspaces\liferay-plugins-sdk-5.2.3\portlets\hello-portlet\docro
ot\WEB-INF\service\com\sample\portlet\library\service\persistence\LibraryUserPer
sistence.java:115: getBooks(long) is already defined in com.sample.portlet.libra
ry.service.persistence.LibraryUserPersistence
[javac] public java.util.List<com.sample.portlet.library.model.book> get
Books(</com.sample.portlet.library.model.book>
Is this a new bug or ? I can not believe that nobody needed this feature.
Thank you
Peter
Peter Ruzicka, modificado hace 14 años.
RE: ServiceBuilder - mapping-key problem
Junior Member Mensajes: 48 Fecha de incorporación: 7/12/06 Mensajes recientes
Found this bug reported for long long time :o(
http://issues.liferay.com/browse/LPS-203
Nobody really needs this? If yes, please vote for bug-fix.
Peter
http://issues.liferay.com/browse/LPS-203
Nobody really needs this? If yes, please vote for bug-fix.
Peter
Sam Bergenstrahle, modificado hace 11 años.
RE: ServiceBuilder - mapping-key problem
New Member Mensajes: 14 Fecha de incorporación: 3/07/09 Mensajes recientes
I needed it today in a time critical project...the last one that leverages Liferay.