You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i am trying to query a model that contains a @reference as attribute like:
public class TaskGroups {
@Reference
Branch branch;
.
.
.
}
and so on, then i have a query with more logic and code but in resume i have to filter by the field _id from Branch object, its just id on the object but on database its _id, ok no problem its normal behavior for the framework.
So when the code runs the query changes the field "branch._id" to only branch! and then no records returned...
With this behavior i needed to make a workaround, mapping the result to just Object and then converting to the taskGroup class , then the query has no modifications on the attribute names and the filter ocurs without problems.
Is this a bug? or its normal behavior to? is there any workaround to avoid this attribute name change when id fields?
Att.
The text was updated successfully, but these errors were encountered:
Thanks for reporting. The MongoDB module operates up @DBRef which is an @Reference but special to the store.
By using @Reference instead of @DBRef the Branch entity will not be linked, but embedded into the TaskGroups object. We're already working to enhance the support for linking (#3602) but for now please switch to @DBRef which should solve the issue.
i am trying to query a model that contains a @reference as attribute like:
and so on, then i have a query with more logic and code but in resume i have to filter by the field _id from Branch object, its just id on the object but on database its _id, ok no problem its normal behavior for the framework.
ok now the code that did not work:
So when the code runs the query changes the field "branch._id" to only branch! and then no records returned...
With this behavior i needed to make a workaround, mapping the result to just Object and then converting to the taskGroup class , then the query has no modifications on the attribute names and the filter ocurs without problems.
Is this a bug? or its normal behavior to? is there any workaround to avoid this attribute name change when id fields?
Att.
The text was updated successfully, but these errors were encountered: