[
https://issues.apache.org/jira/browse/OFBIZ-12193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17295823#comment-17295823
]
Sebastian Berg edited comment on OFBIZ-12193 at 3/5/21, 9:29 AM:
-----------------------------------------------------------------
The error occurs not only for ViewEntity InventoryItemDetailForSum but for all
ViewEntities, which have fields other than function fields without the
specification group-by="true". The problem results from the SQL-Statement which
is put together with all select Fields of the Entity. But for that part every
field in the SELECT section either has to be a function Field or has to be part
of the GROUP_BY section as well. That is not the case here.
Previously (before the changes in OFBIZ-9217) when delegator.find() was called
one parameter was fieldsToSelect which is relevant for ViewEntities. The list
fieldsToSelect was filled with field names if the ModelEntity is a ViewEntity.
fieldsToSelect combines the functionFields and the groupByFields and therefore
a functional SQL-Statement is build.
In the new FindGeneric.groovy where the 'peformFind' Service is used the field
fieldsToSelect was lost during the refactoring.
I tracked down the missing parts and implemented them. Also I had some
difficulties spotting the missing information, because of the strange habit to
put together a String in a groovy File, which gets rendered into an XML
Document into a Form.
I feel like there should be an easier and more readable way to achieve a
dynamic form to search an list Entities. Maybe we can do some refactoring of
this Part in the FindGeneric.groovy in the future.
was (Author: sberg):
The error occurs not only for ViewEntity InventoryItemDetailForSum but for all
ViewEntities, which have fields other than function fields without the
specification group-by="true".
Previously (before the changes in OFBIZ-9217) when delegator.find() was called
one parameter was fieldsToSelect which is relevant for ViewEntities. The list
fieldsToSelect was filled with field names if the ModelEntity is a ViewEntity.
fieldsToSelect combines the functionFields and the groupByFields and therefore
a functional SQL-Statement is build.
In the new FindGeneric.groovy where the 'peformFind' Service is used the field
fieldsToSelect was lost during the refactoring.
I tracked down the missing parts and implemented them. Also I had some
difficulties spotting the missing information, because of the strange habit to
put together a String in a groovy File, which gets rendered into an XML
Document into a Form.
I feel like there should be an easier and more readable way to achieve a
dynamic form to search an list Entities. Maybe we can do some refactoring of
this Part in the FindGeneric.groovy in the future.
> Cant search ViewEntity InventoryItemDetailForSum
> ------------------------------------------------
>
> Key: OFBIZ-12193
> URL: https://issues.apache.org/jira/browse/OFBIZ-12193
> Project: OFBiz
> Issue Type: Bug
> Affects Versions: Release Branch 18.12, Release Branch 17.12, Trunk
> Reporter: Sebastian Berg
> Assignee: Sebastian Berg
> Priority: Major
>
> Go to Entity Engine - > search entity InventoryItemDetailForSum (view entity)
> -> search for entries -> an error message is shown.
> A SQL exception occurred running the service executeFind
--
This message was sent by Atlassian Jira
(v8.3.4#803005)