Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
RE: Finder in service builder use wrong table name.
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
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...
I mean, the <entity /> tag has a table attribute to specify the actual table name that won't include the namespace...
Thanks David.
Yes the service is like this:
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"
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"
hey, that's really hard to read, can you strip out all of the styling stuff so I can see just the code?
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"
<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"
what version of Liferay is this?
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!
Copyright © 2025 Liferay, Inc
• Privacy Policy
Powered by Liferay™