RE: Finder in service builder use wrong table name.

thumbnail
Joaquin Cabal, modified 6 Years ago. Regular Member Posts: 106 Join Date: 9/7/09 Recent Posts
HI! Im using service builder for create a model of Articles. Have a namespace x. When try to create a finder. It use the table name without the namespace. Is this a bug? Or Im doing somethig wrong? Thanks!   Info: Liferay DXP 7.0.10
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
just the finder is wrong, or does the table name also miss the X?


I mean, the <entity /> tag has a table attribute to specify the actual table name that won't include the namespace...
thumbnail
Joaquin Cabal, modified 6 Years ago. Regular Member Posts: 106 Join Date: 9/7/09 Recent Posts
Thanks David.

Yes the service is like this:
[color=#a9b7c6][font="DejaVu Sans Mono"][size=9pt][color=#e8bf6a]<namespace>[/color]NAMESPACE_X[color=#e8bf6a]</namespace>[/color][/size][/font][/color]
[color=#a9b7c6][font="DejaVu Sans Mono"][size=9pt][color=#e8bf6a]<entity [ color][color="#e8bf6a]">[/color][/size][/font][/color]</entity>
In the persistenceImpl the generated query for table is:

[color=#a9b7c6][font="DejaVu Sans Mono"][size=9pt][color=#cc7832]private static final [/color]String [color=#9876aa][i]_SQL_SELECT_ARTICLE [/i][/color]= [color=#6a8759]"SELECT article FROM Article article"[/color][color=#cc7832];[/color][/size][/font][/color]

So is no generating the "NAMESPACE_X_Article" table name. Or at least I dont see where it adds the namespace
The query does not work and print the sql like "Article" instead of "NAMESPACE_X_Article"
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
hey, that's really hard to read, can you strip out all of the styling stuff so I can see just the code?
thumbnail
Joaquin Cabal, modified 6 Years ago. Regular Member Posts: 106 Join Date: 9/7/09 Recent Posts
Yes David! sorry.
<namespace>NAMESPACE_X</namespace>
<entity local-service="true"  name="Article" remote-service="true" uuid="true">
private static final String _SQL_SELECT_ARTICLE  = "SELECT article FROM Article article"
thumbnail
David H Nebinger, modified 6 Years ago. Liferay Legend Posts: 14933 Join Date: 9/2/06 Recent Posts
what version of Liferay is this?
thumbnail
Joaquin Cabal, modified 5 Years ago. Regular Member Posts: 106 Join Date: 9/7/09 Recent Posts
Sorry for delay David. I just see this. I could fix it. The problem was other. The tables were not created. Just the first time create the table  ok but after that in future deploys I need to do some workaround. https://issues.liferay.com/browse/LPS-67688 . Thanks!