entitymodel - entity-condition inside view-link does not work
------------------------------------------------------------- Key: OFBIZ-4781 URL: https://issues.apache.org/jira/browse/OFBIZ-4781 Project: OFBiz Issue Type: Bug Components: framework Affects Versions: Release Branch 11.04 Environment: Win Xp, java 1.6.0_23 Reporter: Wojciech Szymanowski Inside entitymodel.xml file - when I put entity-condition tag inside view-link tag it does not affect db query at all. Condition from entity-condition tag should be added to join statement. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
[ https://issues.apache.org/jira/browse/OFBIZ-4781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13262272#comment-13262272 ] Daniel Riquelme commented on OFBIZ-4781: ---------------------------------------- Hi, it works for me. Could you post the entity view that gave you the problem ? > entitymodel - entity-condition inside view-link does not work > ------------------------------------------------------------- > > Key: OFBIZ-4781 > URL: https://issues.apache.org/jira/browse/OFBIZ-4781 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: Release Branch 11.04 > Environment: Win Xp, java 1.6.0_23 > Reporter: Wojciech Szymanowski > Labels: entity-condition, view-link > > Inside entitymodel.xml file - when I put entity-condition tag inside view-link tag it does not affect db query at all. Condition from entity-condition tag should be added to join statement. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13262382#comment-13262382 ] Wojciech Szymanowski commented on OFBIZ-4781: --------------------------------------------- Hi, thank You for your answer. Entity example: <view-entity entity-name="PartyAndCustomerRoleType" package-name="org.ofbiz.customerslci"> <member-entity entity-alias="RT" entity-name="RoleType" /> <member-entity entity-alias="PR" entity-name="PartyRole" /> <alias entity-alias="PR" name="partyId"></alias> <alias entity-alias="RT" name="roleDescription" field="description" /> <alias entity-alias="RT" name="roleTypeId" /> <alias entity-alias="RT" name="parentTypeId" /> <view-link entity-alias="RT" rel-entity-alias="PR"> <key-map field-name="roleTypeId" /> <entity-condition> <condition-expr field-name="parentTypeId" value="CUSTOMER" /> </entity-condition> </view-link> </view-entity> The final db query should look like this: SELECT pr.party_id AS pr_party_id, rt.description AS rt_description, rt.role_type_id AS rt_role_type_id, rt.parent_type_id AS rt_parent_type_id FROM PUBLIC.role_type rt INNER JOIN PUBLIC.party_role pr ON rt.role_type_id = pr.role_type_id AND (rt.parent_type_id = 'CUSTOMER') but ofbiz does not generate condition for condition-expr tag (rt.parent_type_id = 'CUSTOMER'). I have looked into code and I think the missing code is in: F:\projekty\lci\ofbiz\framework\entity\src\org\ofbiz\entity\jdbc\SqlJdbcUtil.java line 180. Now (in 11.04 release) there is only a comment at this line: // TODO add expression from entity-condition on view-link Thanks, Wojciech > entitymodel - entity-condition inside view-link does not work > ------------------------------------------------------------- > > Key: OFBIZ-4781 > URL: https://issues.apache.org/jira/browse/OFBIZ-4781 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: Release Branch 11.04 > Environment: Win Xp, java 1.6.0_23 > Reporter: Wojciech Szymanowski > Labels: entity-condition, view-link > > Inside entitymodel.xml file - when I put entity-condition tag inside view-link tag it does not affect db query at all. Condition from entity-condition tag should be added to join statement. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13262625#comment-13262625 ] Daniel Riquelme commented on OFBIZ-4781: ---------------------------------------- Hi, I took a closer look to this and found that it is implemented in trunk but not in 11.04. In 11.04 instead of the comment you mentioned the following code appears: ModelViewEntity.ViewEntityCondition viewEntityCondition = viewLink.getViewEntityCondition(); if (viewEntityCondition != null) { EntityCondition whereCondition = viewEntityCondition.getWhereCondition(modelFieldTypeReader, null); if (whereCondition != null) { condBuffer.append(" AND "); condBuffer.append(whereCondition.makeWhereString(modelEntity, null, datasourceInfo)); } } I haven't tested this code in 11.04 so I can't tell you if any other modification is needed. I can't tell you wether this code will get any time soon to 11.04, perhaps if you ask this on the dev list you may get a better answer. > entitymodel - entity-condition inside view-link does not work > ------------------------------------------------------------- > > Key: OFBIZ-4781 > URL: https://issues.apache.org/jira/browse/OFBIZ-4781 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: Release Branch 11.04 > Environment: Win Xp, java 1.6.0_23 > Reporter: Wojciech Szymanowski > Labels: entity-condition, view-link > > Inside entitymodel.xml file - when I put entity-condition tag inside view-link tag it does not affect db query at all. Condition from entity-condition tag should be added to join statement. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4781?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13262631#comment-13262631 ] Pierre Smits commented on OFBIZ-4781: ------------------------------------- Release 11.04.01 is expected to be made available to the public after May 15, 2012 > entitymodel - entity-condition inside view-link does not work > ------------------------------------------------------------- > > Key: OFBIZ-4781 > URL: https://issues.apache.org/jira/browse/OFBIZ-4781 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: Release Branch 11.04 > Environment: Win Xp, java 1.6.0_23 > Reporter: Wojciech Szymanowski > Labels: entity-condition, view-link > > Inside entitymodel.xml file - when I put entity-condition tag inside view-link tag it does not affect db query at all. Condition from entity-condition tag should be added to join statement. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4781?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux closed OFBIZ-4781. ---------------------------------- Resolution: Fixed Fix Version/s: Release Branch 11.04 Release Branch 10.04 Assignee: Jacques Le Roux Backported from trunk at r1327735 R11.04 r1331251 R10.04 r1331250 > entitymodel - entity-condition inside view-link does not work > ------------------------------------------------------------- > > Key: OFBIZ-4781 > URL: https://issues.apache.org/jira/browse/OFBIZ-4781 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: Release Branch 11.04 > Environment: Win Xp, java 1.6.0_23 > Reporter: Wojciech Szymanowski > Assignee: Jacques Le Roux > Labels: entity-condition, view-link > Fix For: Release Branch 10.04, Release Branch 11.04 > > > Inside entitymodel.xml file - when I put entity-condition tag inside view-link tag it does not affect db query at all. Condition from entity-condition tag should be added to join statement. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
Thanks Jacques
Regards, Pierre Op 27 april 2012 08:59 schreef Jacques Le Roux (JIRA) <[hidden email]> het volgende: > > [ > https://issues.apache.org/jira/browse/OFBIZ-4781?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel] > > Jacques Le Roux closed OFBIZ-4781. > ---------------------------------- > > Resolution: Fixed > Fix Version/s: Release Branch 11.04 > Release Branch 10.04 > Assignee: Jacques Le Roux > > Backported from trunk at r1327735 > > R11.04 r1331251 > R10.04 r1331250 > > > > entitymodel - entity-condition inside view-link does not work > > ------------------------------------------------------------- > > > > Key: OFBIZ-4781 > > URL: https://issues.apache.org/jira/browse/OFBIZ-4781 > > Project: OFBiz > > Issue Type: Bug > > Components: framework > > Affects Versions: Release Branch 11.04 > > Environment: Win Xp, java 1.6.0_23 > > Reporter: Wojciech Szymanowski > > Assignee: Jacques Le Roux > > Labels: entity-condition, view-link > > Fix For: Release Branch 10.04, Release Branch 11.04 > > > > > > Inside entitymodel.xml file - when I put entity-condition tag inside > view-link tag it does not affect db query at all. Condition from > entity-condition tag should be added to join statement. > > -- > This message is automatically generated by JIRA. > If you think it was sent incorrectly, please contact your JIRA > administrators: > https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa > For more information on JIRA, see: http://www.atlassian.com/software/jira > > > |
In reply to this post by Nicolas Malin (Jira)
[ https://issues.apache.org/jira/browse/OFBIZ-4781?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jacques Le Roux reopened OFBIZ-4781: ------------------------------------ Thanks to Amit Sharma who called me, this needed to be reverted: does not compile > entitymodel - entity-condition inside view-link does not work > ------------------------------------------------------------- > > Key: OFBIZ-4781 > URL: https://issues.apache.org/jira/browse/OFBIZ-4781 > Project: OFBiz > Issue Type: Bug > Components: framework > Affects Versions: Release Branch 11.04 > Environment: Win Xp, java 1.6.0_23 > Reporter: Wojciech Szymanowski > Assignee: Jacques Le Roux > Labels: entity-condition, view-link > Fix For: Release Branch 10.04, Release Branch 11.04 > > > Inside entitymodel.xml file - when I put entity-condition tag inside view-link tag it does not affect db query at all. Condition from entity-condition tag should be added to join statement. -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira |
Free forum by Nabble | Edit this page |