Hello All,
Please help me in understanding that is it feasible to use one view entity as a member entity into another view entity? I have tried to do so and saw the log for prepared statement in SQLProcessor.java. Found that there are so many inner joins in the query on console. Thanks in advance for any help. Regards -- Pranay Pandey smime.p7s (3K) Download Attachment |
Here for reference I am posting the view entity which has been created
and log I got while fetching records. <view-entity entity-name="OrderItemAndFacilityLocation" package- name="org.ofbiz.product.facility" title="Order Item And Facility Location View Entity"> <member-entity entity-alias="SMT" entity- name="ShipmentMethodType"/> <member-entity entity-alias="OISG" entity- name="OrderItemShipGroup"/> <member-entity entity-alias="OI" entity-name="OrderItem"/> <member-entity entity-alias="PFLV" entity- name="ProductFacilityLocationView"/> <alias entity-alias="OISG" name="orderId"/> <alias entity-alias="OISG" name="shipGroupSeqId"/> <alias entity-alias="OISG" name="shipmentMethodTypeId"/> <alias entity-alias="OISG" name="carrierPartyId"/> <alias entity-alias="OI" name="productId"/> <alias entity-alias="OI" name="orderItemSeqId"/> <alias entity-alias="PFLV" name="locationSeqId"/> <alias entity-alias="PFLV" name="locationTypeEnumId"/> <view-link entity-alias="PFLV" rel-entity-alias="OI"> <key-map field-name="productId"/> </view-link> <view-link entity-alias="OI" rel-entity-alias="OISG"> <key-map field-name="orderId"/> </view-link> <view-link entity-alias="OISG" rel-entity-alias="SMT"> <key-map field-name="shipmentMethodTypeId"/> </view-link> <relation type="one-nofk" rel-entity-name="ShipmentMethodType"> <key-map field-name="shipmentMethodTypeId"/> </relation> </view-entity> and log: ============================ SELECT OISG.ORDER_ID, OISG.SHIP_GROUP_SEQ_ID, OISG.SHIPMENT_METHOD_TYPE_ID, OISG.CARRIER_PARTY_ID, OI.PRODUCT_ID, OI.ORDER_ITEM_SEQ_ID, PFLV.PFL_LOCATION_SEQ_ID, PFLV.FL_LOCATION_TYPE_ENUM_ID FROM (((SELECT PFL.PRODUCT_ID AS PFL_PRODUCT_ID, PFL.FACILITY_ID AS PFL_FACILITY_ID, PFL.LOCATION_SEQ_ID AS PFL_LOCATION_SEQ_ID, PFL.MINIMUM_STOCK AS PFL_MINIMUM_STOCK, PFL.MOVE_QUANTITY AS PFL_MOVE_QUANTITY, FL.LOCATION_TYPE_ENUM_ID AS FL_LOCATION_TYPE_ENUM_ID, FL.AREA_ID AS FL_AREA_ID, FL.AISLE_ID AS FL_AISLE_ID, FL.SECTION_ID AS FL_SECTION_ID, FL.LEVEL_ID AS FL_LEVEL_ID, FL.POSITION_ID AS FL_POSITION_ID FROM OFBIZ.PRODUCT_FACILITY_LOCATION PFL INNER JOIN OFBIZ.FACILITY_LOCATION FL ON PFL.FACILITY_ID = FL.FACILITY_ID AND PFL.LOCATION_SEQ_ID = FL.LOCATION_SEQ_ID) PFLV INNER JOIN OFBIZ.ORDER_ITEM OI ON PFLV.PFL_PRODUCT_ID = OI.PRODUCT_ID) INNER JOIN OFBIZ.ORDER_ITEM_SHIP_GROUP OISG ON OI.ORDER_ID = OISG.ORDER_ID) INNER JOIN OFBIZ.SHIPMENT_METHOD_TYPE SMT ON OISG.SHIPMENT_METHOD_TYPE_ID = SMT.SHIPMENT_METHOD_TYPE_ID WHERE (OISG.ORDER_ID = ? AND PFLV.FL_LOCATION_TYPE_ENUM_ID = ? AND OI.ORDER_ITEM_SEQ_ID = ?) ORDER BY OI.ORDER_ITEM_SEQ_ID ASC ============================= Thanks & Regards -- Pranay Pandey On Mar 23, 2009, at 3:51 PM, Pranay Pandey wrote: > Hello All, > > Please help me in understanding that is it feasible to use one view > entity as a member entity into another view entity? > > I have tried to do so and saw the log for prepared statement in > SQLProcessor.java. Found that there are so many inner joins in the > query on console. > > Thanks in advance for any help. > > Regards > -- > Pranay Pandey > > > smime.p7s (3K) Download Attachment |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 What seems to be the problem what is not working Pranay Pandey sent the following on 3/23/2009 3:45 AM: > Here for reference I am posting the view entity which has been created > and log I got while fetching records. > > <view-entity entity-name="OrderItemAndFacilityLocation" > package-name="org.ofbiz.product.facility" title="Order Item And Facility > Location View Entity"> > <member-entity entity-alias="SMT" entity-name="ShipmentMethodType"/> > <member-entity entity-alias="OISG" entity-name="OrderItemShipGroup"/> > <member-entity entity-alias="OI" entity-name="OrderItem"/> > <member-entity entity-alias="PFLV" > entity-name="ProductFacilityLocationView"/> > <alias entity-alias="OISG" name="orderId"/> > <alias entity-alias="OISG" name="shipGroupSeqId"/> > <alias entity-alias="OISG" name="shipmentMethodTypeId"/> > <alias entity-alias="OISG" name="carrierPartyId"/> > <alias entity-alias="OI" name="productId"/> > <alias entity-alias="OI" name="orderItemSeqId"/> > <alias entity-alias="PFLV" name="locationSeqId"/> > <alias entity-alias="PFLV" name="locationTypeEnumId"/> > <view-link entity-alias="PFLV" rel-entity-alias="OI"> > <key-map field-name="productId"/> > </view-link> > <view-link entity-alias="OI" rel-entity-alias="OISG"> > <key-map field-name="orderId"/> > </view-link> > <view-link entity-alias="OISG" rel-entity-alias="SMT"> > <key-map field-name="shipmentMethodTypeId"/> > </view-link> > <relation type="one-nofk" rel-entity-name="ShipmentMethodType"> > <key-map field-name="shipmentMethodTypeId"/> > </relation> > </view-entity> > > > and log: > ============================ > SELECT OISG.ORDER_ID, OISG.SHIP_GROUP_SEQ_ID, > OISG.SHIPMENT_METHOD_TYPE_ID, OISG.CARRIER_PARTY_ID, OI.PRODUCT_ID, > OI.ORDER_ITEM_SEQ_ID, PFLV.PFL_LOCATION_SEQ_ID, > PFLV.FL_LOCATION_TYPE_ENUM_ID FROM (((SELECT PFL.PRODUCT_ID AS > PFL_PRODUCT_ID, PFL.FACILITY_ID AS PFL_FACILITY_ID, PFL.LOCATION_SEQ_ID > AS PFL_LOCATION_SEQ_ID, PFL.MINIMUM_STOCK AS PFL_MINIMUM_STOCK, > PFL.MOVE_QUANTITY AS PFL_MOVE_QUANTITY, FL.LOCATION_TYPE_ENUM_ID AS > FL_LOCATION_TYPE_ENUM_ID, FL.AREA_ID AS FL_AREA_ID, FL.AISLE_ID AS > FL_AISLE_ID, FL.SECTION_ID AS FL_SECTION_ID, FL.LEVEL_ID AS FL_LEVEL_ID, > FL.POSITION_ID AS FL_POSITION_ID FROM OFBIZ.PRODUCT_FACILITY_LOCATION > PFL INNER JOIN OFBIZ.FACILITY_LOCATION FL ON PFL.FACILITY_ID = > FL.FACILITY_ID AND PFL.LOCATION_SEQ_ID = FL.LOCATION_SEQ_ID) PFLV INNER > JOIN OFBIZ.ORDER_ITEM OI ON PFLV.PFL_PRODUCT_ID = OI.PRODUCT_ID) INNER > JOIN OFBIZ.ORDER_ITEM_SHIP_GROUP OISG ON OI.ORDER_ID = OISG.ORDER_ID) > INNER JOIN OFBIZ.SHIPMENT_METHOD_TYPE SMT ON > OISG.SHIPMENT_METHOD_TYPE_ID = SMT.SHIPMENT_METHOD_TYPE_ID WHERE > (OISG.ORDER_ID = ? AND PFLV.FL_LOCATION_TYPE_ENUM_ID = ? AND > OI.ORDER_ITEM_SEQ_ID = ?) ORDER BY OI.ORDER_ITEM_SEQ_ID ASC > ============================= > > Thanks & Regards > -- > Pranay Pandey > > > On Mar 23, 2009, at 3:51 PM, Pranay Pandey wrote: > >> Hello All, >> >> Please help me in understanding that is it feasible to use one view >> entity as a member entity into another view entity? >> >> I have tried to do so and saw the log for prepared statement in >> SQLProcessor.java. Found that there are so many inner joins in the >> query on console. >> >> Thanks in advance for any help. >> >> Regards >> -- >> Pranay Pandey >> >> >> > Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJx3DNrP3NbaWWqE4RAoz6AJ9BNX4Y0PQRd90kWGv1KoGQSalAGwCcDt7Z CVCddvLEPo2pt3rGy1S5j64= =02uo -----END PGP SIGNATURE----- |
Looking at very first mail will help to understand the question.
Thanks Divesh BJ Freeman wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > What seems to be the problem > what is not working > > > Pranay Pandey sent the following on 3/23/2009 3:45 AM: > >> Here for reference I am posting the view entity which has been created >> and log I got while fetching records. >> >> <view-entity entity-name="OrderItemAndFacilityLocation" >> package-name="org.ofbiz.product.facility" title="Order Item And Facility >> Location View Entity"> >> <member-entity entity-alias="SMT" entity-name="ShipmentMethodType"/> >> <member-entity entity-alias="OISG" entity-name="OrderItemShipGroup"/> >> <member-entity entity-alias="OI" entity-name="OrderItem"/> >> <member-entity entity-alias="PFLV" >> entity-name="ProductFacilityLocationView"/> >> <alias entity-alias="OISG" name="orderId"/> >> <alias entity-alias="OISG" name="shipGroupSeqId"/> >> <alias entity-alias="OISG" name="shipmentMethodTypeId"/> >> <alias entity-alias="OISG" name="carrierPartyId"/> >> <alias entity-alias="OI" name="productId"/> >> <alias entity-alias="OI" name="orderItemSeqId"/> >> <alias entity-alias="PFLV" name="locationSeqId"/> >> <alias entity-alias="PFLV" name="locationTypeEnumId"/> >> <view-link entity-alias="PFLV" rel-entity-alias="OI"> >> <key-map field-name="productId"/> >> </view-link> >> <view-link entity-alias="OI" rel-entity-alias="OISG"> >> <key-map field-name="orderId"/> >> </view-link> >> <view-link entity-alias="OISG" rel-entity-alias="SMT"> >> <key-map field-name="shipmentMethodTypeId"/> >> </view-link> >> <relation type="one-nofk" rel-entity-name="ShipmentMethodType"> >> <key-map field-name="shipmentMethodTypeId"/> >> </relation> >> </view-entity> >> >> >> and log: >> ============================ >> SELECT OISG.ORDER_ID, OISG.SHIP_GROUP_SEQ_ID, >> OISG.SHIPMENT_METHOD_TYPE_ID, OISG.CARRIER_PARTY_ID, OI.PRODUCT_ID, >> OI.ORDER_ITEM_SEQ_ID, PFLV.PFL_LOCATION_SEQ_ID, >> PFLV.FL_LOCATION_TYPE_ENUM_ID FROM (((SELECT PFL.PRODUCT_ID AS >> PFL_PRODUCT_ID, PFL.FACILITY_ID AS PFL_FACILITY_ID, PFL.LOCATION_SEQ_ID >> AS PFL_LOCATION_SEQ_ID, PFL.MINIMUM_STOCK AS PFL_MINIMUM_STOCK, >> PFL.MOVE_QUANTITY AS PFL_MOVE_QUANTITY, FL.LOCATION_TYPE_ENUM_ID AS >> FL_LOCATION_TYPE_ENUM_ID, FL.AREA_ID AS FL_AREA_ID, FL.AISLE_ID AS >> FL_AISLE_ID, FL.SECTION_ID AS FL_SECTION_ID, FL.LEVEL_ID AS FL_LEVEL_ID, >> FL.POSITION_ID AS FL_POSITION_ID FROM OFBIZ.PRODUCT_FACILITY_LOCATION >> PFL INNER JOIN OFBIZ.FACILITY_LOCATION FL ON PFL.FACILITY_ID = >> FL.FACILITY_ID AND PFL.LOCATION_SEQ_ID = FL.LOCATION_SEQ_ID) PFLV INNER >> JOIN OFBIZ.ORDER_ITEM OI ON PFLV.PFL_PRODUCT_ID = OI.PRODUCT_ID) INNER >> JOIN OFBIZ.ORDER_ITEM_SHIP_GROUP OISG ON OI.ORDER_ID = OISG.ORDER_ID) >> INNER JOIN OFBIZ.SHIPMENT_METHOD_TYPE SMT ON >> OISG.SHIPMENT_METHOD_TYPE_ID = SMT.SHIPMENT_METHOD_TYPE_ID WHERE >> (OISG.ORDER_ID = ? AND PFLV.FL_LOCATION_TYPE_ENUM_ID = ? AND >> OI.ORDER_ITEM_SEQ_ID = ?) ORDER BY OI.ORDER_ITEM_SEQ_ID ASC >> ============================= >> >> Thanks & Regards >> -- >> Pranay Pandey >> >> >> On Mar 23, 2009, at 3:51 PM, Pranay Pandey wrote: >> >> >>> Hello All, >>> >>> Please help me in understanding that is it feasible to use one view >>> entity as a member entity into another view entity? >>> >>> I have tried to do so and saw the log for prepared statement in >>> SQLProcessor.java. Found that there are so many inner joins in the >>> query on console. >>> >>> Thanks in advance for any help. >>> >>> Regards >>> -- >>> Pranay Pandey >>> >>> >>> >>> > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFJx3DNrP3NbaWWqE4RAoz6AJ9BNX4Y0PQRd90kWGv1KoGQSalAGwCcDt7Z > CVCddvLEPo2pt3rGy1S5j64= > =02uo > -----END PGP SIGNATURE----- > |
In reply to this post by BJ Freeman
BJ,
Here I am posting my question again for reference from my first email: Please help me in understanding that is it feasible to use one view entity as a member entity into another view entity? Thanks & Regards -- Pranay Pandey On Mar 23, 2009, at 4:51 PM, BJ Freeman wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > What seems to be the problem > what is not working > > > Pranay Pandey sent the following on 3/23/2009 3:45 AM: >> Here for reference I am posting the view entity which has been >> created >> and log I got while fetching records. >> >> <view-entity entity-name="OrderItemAndFacilityLocation" >> package-name="org.ofbiz.product.facility" title="Order Item And >> Facility >> Location View Entity"> >> <member-entity entity-alias="SMT" entity- >> name="ShipmentMethodType"/> >> <member-entity entity-alias="OISG" entity- >> name="OrderItemShipGroup"/> >> <member-entity entity-alias="OI" entity-name="OrderItem"/> >> <member-entity entity-alias="PFLV" >> entity-name="ProductFacilityLocationView"/> >> <alias entity-alias="OISG" name="orderId"/> >> <alias entity-alias="OISG" name="shipGroupSeqId"/> >> <alias entity-alias="OISG" name="shipmentMethodTypeId"/> >> <alias entity-alias="OISG" name="carrierPartyId"/> >> <alias entity-alias="OI" name="productId"/> >> <alias entity-alias="OI" name="orderItemSeqId"/> >> <alias entity-alias="PFLV" name="locationSeqId"/> >> <alias entity-alias="PFLV" name="locationTypeEnumId"/> >> <view-link entity-alias="PFLV" rel-entity-alias="OI"> >> <key-map field-name="productId"/> >> </view-link> >> <view-link entity-alias="OI" rel-entity-alias="OISG"> >> <key-map field-name="orderId"/> >> </view-link> >> <view-link entity-alias="OISG" rel-entity-alias="SMT"> >> <key-map field-name="shipmentMethodTypeId"/> >> </view-link> >> <relation type="one-nofk" rel-entity-name="ShipmentMethodType"> >> <key-map field-name="shipmentMethodTypeId"/> >> </relation> >> </view-entity> >> >> >> and log: >> ============================ >> SELECT OISG.ORDER_ID, OISG.SHIP_GROUP_SEQ_ID, >> OISG.SHIPMENT_METHOD_TYPE_ID, OISG.CARRIER_PARTY_ID, OI.PRODUCT_ID, >> OI.ORDER_ITEM_SEQ_ID, PFLV.PFL_LOCATION_SEQ_ID, >> PFLV.FL_LOCATION_TYPE_ENUM_ID FROM (((SELECT PFL.PRODUCT_ID AS >> PFL_PRODUCT_ID, PFL.FACILITY_ID AS PFL_FACILITY_ID, >> PFL.LOCATION_SEQ_ID >> AS PFL_LOCATION_SEQ_ID, PFL.MINIMUM_STOCK AS PFL_MINIMUM_STOCK, >> PFL.MOVE_QUANTITY AS PFL_MOVE_QUANTITY, FL.LOCATION_TYPE_ENUM_ID AS >> FL_LOCATION_TYPE_ENUM_ID, FL.AREA_ID AS FL_AREA_ID, FL.AISLE_ID AS >> FL_AISLE_ID, FL.SECTION_ID AS FL_SECTION_ID, FL.LEVEL_ID AS >> FL_LEVEL_ID, >> FL.POSITION_ID AS FL_POSITION_ID FROM OFBIZ.PRODUCT_FACILITY_LOCATION >> PFL INNER JOIN OFBIZ.FACILITY_LOCATION FL ON PFL.FACILITY_ID = >> FL.FACILITY_ID AND PFL.LOCATION_SEQ_ID = FL.LOCATION_SEQ_ID) PFLV >> INNER >> JOIN OFBIZ.ORDER_ITEM OI ON PFLV.PFL_PRODUCT_ID = OI.PRODUCT_ID) >> INNER >> JOIN OFBIZ.ORDER_ITEM_SHIP_GROUP OISG ON OI.ORDER_ID = OISG.ORDER_ID) >> INNER JOIN OFBIZ.SHIPMENT_METHOD_TYPE SMT ON >> OISG.SHIPMENT_METHOD_TYPE_ID = SMT.SHIPMENT_METHOD_TYPE_ID WHERE >> (OISG.ORDER_ID = ? AND PFLV.FL_LOCATION_TYPE_ENUM_ID = ? AND >> OI.ORDER_ITEM_SEQ_ID = ?) ORDER BY OI.ORDER_ITEM_SEQ_ID ASC >> ============================= >> >> Thanks & Regards >> -- >> Pranay Pandey >> >> >> On Mar 23, 2009, at 3:51 PM, Pranay Pandey wrote: >> >>> Hello All, >>> >>> Please help me in understanding that is it feasible to use one view >>> entity as a member entity into another view entity? >>> >>> I have tried to do so and saw the log for prepared statement in >>> SQLProcessor.java. Found that there are so many inner joins in the >>> query on console. >>> >>> Thanks in advance for any help. >>> >>> Regards >>> -- >>> Pranay Pandey >>> >>> >>> >> > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.6 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iD8DBQFJx3DNrP3NbaWWqE4RAoz6AJ9BNX4Y0PQRd90kWGv1KoGQSalAGwCcDt7Z > CVCddvLEPo2pt3rGy1S5j64= > =02uo > -----END PGP SIGNATURE----- smime.p7s (3K) Download Attachment |
Is it feasible? That depends on the constraints you're working with. It does usually work and can be done, but also often results in asking the database to do more than your code really needs it to do (ie including things in the joins that you don't need, significantly slowing performance). The same is true of poorly defined view-entities with normal (non-view) member entities, but there is more of a tendency for that with views of views. -David On Mar 23, 2009, at 5:36 AM, Pranay Pandey wrote: > BJ, > > Here I am posting my question again for reference from my first email: > > Please help me in understanding that is it feasible to use one view > entity as a member entity into another view entity? > > Thanks & Regards > -- > Pranay Pandey > > > On Mar 23, 2009, at 4:51 PM, BJ Freeman wrote: > >> -----BEGIN PGP SIGNED MESSAGE----- >> Hash: SHA1 >> >> What seems to be the problem >> what is not working >> >> >> Pranay Pandey sent the following on 3/23/2009 3:45 AM: >>> Here for reference I am posting the view entity which has been >>> created >>> and log I got while fetching records. >>> >>> <view-entity entity-name="OrderItemAndFacilityLocation" >>> package-name="org.ofbiz.product.facility" title="Order Item And >>> Facility >>> Location View Entity"> >>> <member-entity entity-alias="SMT" entity- >>> name="ShipmentMethodType"/> >>> <member-entity entity-alias="OISG" entity- >>> name="OrderItemShipGroup"/> >>> <member-entity entity-alias="OI" entity-name="OrderItem"/> >>> <member-entity entity-alias="PFLV" >>> entity-name="ProductFacilityLocationView"/> >>> <alias entity-alias="OISG" name="orderId"/> >>> <alias entity-alias="OISG" name="shipGroupSeqId"/> >>> <alias entity-alias="OISG" name="shipmentMethodTypeId"/> >>> <alias entity-alias="OISG" name="carrierPartyId"/> >>> <alias entity-alias="OI" name="productId"/> >>> <alias entity-alias="OI" name="orderItemSeqId"/> >>> <alias entity-alias="PFLV" name="locationSeqId"/> >>> <alias entity-alias="PFLV" name="locationTypeEnumId"/> >>> <view-link entity-alias="PFLV" rel-entity-alias="OI"> >>> <key-map field-name="productId"/> >>> </view-link> >>> <view-link entity-alias="OI" rel-entity-alias="OISG"> >>> <key-map field-name="orderId"/> >>> </view-link> >>> <view-link entity-alias="OISG" rel-entity-alias="SMT"> >>> <key-map field-name="shipmentMethodTypeId"/> >>> </view-link> >>> <relation type="one-nofk" rel-entity-name="ShipmentMethodType"> >>> <key-map field-name="shipmentMethodTypeId"/> >>> </relation> >>> </view-entity> >>> >>> >>> and log: >>> ============================ >>> SELECT OISG.ORDER_ID, OISG.SHIP_GROUP_SEQ_ID, >>> OISG.SHIPMENT_METHOD_TYPE_ID, OISG.CARRIER_PARTY_ID, OI.PRODUCT_ID, >>> OI.ORDER_ITEM_SEQ_ID, PFLV.PFL_LOCATION_SEQ_ID, >>> PFLV.FL_LOCATION_TYPE_ENUM_ID FROM (((SELECT PFL.PRODUCT_ID AS >>> PFL_PRODUCT_ID, PFL.FACILITY_ID AS PFL_FACILITY_ID, >>> PFL.LOCATION_SEQ_ID >>> AS PFL_LOCATION_SEQ_ID, PFL.MINIMUM_STOCK AS PFL_MINIMUM_STOCK, >>> PFL.MOVE_QUANTITY AS PFL_MOVE_QUANTITY, FL.LOCATION_TYPE_ENUM_ID AS >>> FL_LOCATION_TYPE_ENUM_ID, FL.AREA_ID AS FL_AREA_ID, FL.AISLE_ID AS >>> FL_AISLE_ID, FL.SECTION_ID AS FL_SECTION_ID, FL.LEVEL_ID AS >>> FL_LEVEL_ID, >>> FL.POSITION_ID AS FL_POSITION_ID FROM >>> OFBIZ.PRODUCT_FACILITY_LOCATION >>> PFL INNER JOIN OFBIZ.FACILITY_LOCATION FL ON PFL.FACILITY_ID = >>> FL.FACILITY_ID AND PFL.LOCATION_SEQ_ID = FL.LOCATION_SEQ_ID) PFLV >>> INNER >>> JOIN OFBIZ.ORDER_ITEM OI ON PFLV.PFL_PRODUCT_ID = OI.PRODUCT_ID) >>> INNER >>> JOIN OFBIZ.ORDER_ITEM_SHIP_GROUP OISG ON OI.ORDER_ID = >>> OISG.ORDER_ID) >>> INNER JOIN OFBIZ.SHIPMENT_METHOD_TYPE SMT ON >>> OISG.SHIPMENT_METHOD_TYPE_ID = SMT.SHIPMENT_METHOD_TYPE_ID WHERE >>> (OISG.ORDER_ID = ? AND PFLV.FL_LOCATION_TYPE_ENUM_ID = ? AND >>> OI.ORDER_ITEM_SEQ_ID = ?) ORDER BY OI.ORDER_ITEM_SEQ_ID ASC >>> ============================= >>> >>> Thanks & Regards >>> -- >>> Pranay Pandey >>> >>> >>> On Mar 23, 2009, at 3:51 PM, Pranay Pandey wrote: >>> >>>> Hello All, >>>> >>>> Please help me in understanding that is it feasible to use one >>>> view >>>> entity as a member entity into another view entity? >>>> >>>> I have tried to do so and saw the log for prepared statement in >>>> SQLProcessor.java. Found that there are so many inner joins in the >>>> query on console. >>>> >>>> Thanks in advance for any help. >>>> >>>> Regards >>>> -- >>>> Pranay Pandey >>>> >>>> >>>> >>> >> -----BEGIN PGP SIGNATURE----- >> Version: GnuPG v1.4.6 (MingW32) >> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >> >> iD8DBQFJx3DNrP3NbaWWqE4RAoz6AJ9BNX4Y0PQRd90kWGv1KoGQSalAGwCcDt7Z >> CVCddvLEPo2pt3rGy1S5j64= >> =02uo >> -----END PGP SIGNATURE----- > |
In reply to this post by Pranay Pandey-2
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 My question is if you run it does it work I have had a lot more complicated sql queries than this. so unless you not getting information, or it is taking a very long time to get, then I don't see a problem. if you not getting information then maybe look at the code the build the query. if you it is taking to long then look at the indexes and/or the actual DB you are using. so I ask again what is not working? Pranay Pandey sent the following on 3/23/2009 4:36 AM: > BJ, > > Here I am posting my question again for reference from my first email: > > Please help me in understanding that is it feasible to use one view > entity as a member entity into another view entity? > > Thanks & Regards > -- > Pranay Pandey > > > On Mar 23, 2009, at 4:51 PM, BJ Freeman wrote: > > What seems to be the problem > what is not working > > > Pranay Pandey sent the following on 3/23/2009 3:45 AM: >>>> Here for reference I am posting the view entity which has been created >>>> and log I got while fetching records. >>>> >>>> <view-entity entity-name="OrderItemAndFacilityLocation" >>>> package-name="org.ofbiz.product.facility" title="Order Item And Facility >>>> Location View Entity"> >>>> <member-entity entity-alias="SMT" entity-name="ShipmentMethodType"/> >>>> <member-entity entity-alias="OISG" entity-name="OrderItemShipGroup"/> >>>> <member-entity entity-alias="OI" entity-name="OrderItem"/> >>>> <member-entity entity-alias="PFLV" >>>> entity-name="ProductFacilityLocationView"/> >>>> <alias entity-alias="OISG" name="orderId"/> >>>> <alias entity-alias="OISG" name="shipGroupSeqId"/> >>>> <alias entity-alias="OISG" name="shipmentMethodTypeId"/> >>>> <alias entity-alias="OISG" name="carrierPartyId"/> >>>> <alias entity-alias="OI" name="productId"/> >>>> <alias entity-alias="OI" name="orderItemSeqId"/> >>>> <alias entity-alias="PFLV" name="locationSeqId"/> >>>> <alias entity-alias="PFLV" name="locationTypeEnumId"/> >>>> <view-link entity-alias="PFLV" rel-entity-alias="OI"> >>>> <key-map field-name="productId"/> >>>> </view-link> >>>> <view-link entity-alias="OI" rel-entity-alias="OISG"> >>>> <key-map field-name="orderId"/> >>>> </view-link> >>>> <view-link entity-alias="OISG" rel-entity-alias="SMT"> >>>> <key-map field-name="shipmentMethodTypeId"/> >>>> </view-link> >>>> <relation type="one-nofk" rel-entity-name="ShipmentMethodType"> >>>> <key-map field-name="shipmentMethodTypeId"/> >>>> </relation> >>>> </view-entity> >>>> >>>> >>>> and log: >>>> ============================ >>>> SELECT OISG.ORDER_ID, OISG.SHIP_GROUP_SEQ_ID, >>>> OISG.SHIPMENT_METHOD_TYPE_ID, OISG.CARRIER_PARTY_ID, OI.PRODUCT_ID, >>>> OI.ORDER_ITEM_SEQ_ID, PFLV.PFL_LOCATION_SEQ_ID, >>>> PFLV.FL_LOCATION_TYPE_ENUM_ID FROM (((SELECT PFL.PRODUCT_ID AS >>>> PFL_PRODUCT_ID, PFL.FACILITY_ID AS PFL_FACILITY_ID, PFL.LOCATION_SEQ_ID >>>> AS PFL_LOCATION_SEQ_ID, PFL.MINIMUM_STOCK AS PFL_MINIMUM_STOCK, >>>> PFL.MOVE_QUANTITY AS PFL_MOVE_QUANTITY, FL.LOCATION_TYPE_ENUM_ID AS >>>> FL_LOCATION_TYPE_ENUM_ID, FL.AREA_ID AS FL_AREA_ID, FL.AISLE_ID AS >>>> FL_AISLE_ID, FL.SECTION_ID AS FL_SECTION_ID, FL.LEVEL_ID AS FL_LEVEL_ID, >>>> FL.POSITION_ID AS FL_POSITION_ID FROM OFBIZ.PRODUCT_FACILITY_LOCATION >>>> PFL INNER JOIN OFBIZ.FACILITY_LOCATION FL ON PFL.FACILITY_ID = >>>> FL.FACILITY_ID AND PFL.LOCATION_SEQ_ID = FL.LOCATION_SEQ_ID) PFLV INNER >>>> JOIN OFBIZ.ORDER_ITEM OI ON PFLV.PFL_PRODUCT_ID = OI.PRODUCT_ID) INNER >>>> JOIN OFBIZ.ORDER_ITEM_SHIP_GROUP OISG ON OI.ORDER_ID = OISG.ORDER_ID) >>>> INNER JOIN OFBIZ.SHIPMENT_METHOD_TYPE SMT ON >>>> OISG.SHIPMENT_METHOD_TYPE_ID = SMT.SHIPMENT_METHOD_TYPE_ID WHERE >>>> (OISG.ORDER_ID = ? AND PFLV.FL_LOCATION_TYPE_ENUM_ID = ? AND >>>> OI.ORDER_ITEM_SEQ_ID = ?) ORDER BY OI.ORDER_ITEM_SEQ_ID ASC >>>> ============================= >>>> >>>> Thanks & Regards >>>> -- >>>> Pranay Pandey >>>> >>>> >>>> On Mar 23, 2009, at 3:51 PM, Pranay Pandey wrote: >>>> >>>>> Hello All, >>>>> >>>>> Please help me in understanding that is it feasible to use one view >>>>> entity as a member entity into another view entity? >>>>> >>>>> I have tried to do so and saw the log for prepared statement in >>>>> SQLProcessor.java. Found that there are so many inner joins in the >>>>> query on console. >>>>> >>>>> Thanks in advance for any help. >>>>> >>>>> Regards >>>>> -- >>>>> Pranay Pandey >>>>> >>>>> >>>>> >>>> Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJx7tyrP3NbaWWqE4RAgQJAJ9ewjXVf/ShWnA+R8BhsPY9hsP2FACdGbHv P3TQWjPYT7lvy2YFlyQCSzg= =2qGe -----END PGP SIGNATURE----- |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1 - From a design point of view this is both an ofbiz question and a DB question. So first you must determine the constraints of each db that ofbiz is currently setup to use, as far as joins. Then based on that is there a way ofbiz can generate the code to support each DB's constraint, reasonably. Taking the DB that has the worst constraints would be the limit ofbiz could do. BJ Freeman sent the following on 3/23/2009 9:40 AM: > My question is if you run it does it work > I have had a lot more complicated sql queries than this. > so unless you not getting information, or it is taking a very long time > to get, then I don't see a problem. > if you not getting information then maybe look at the code the build the > query. > if you it is taking to long then look at the indexes and/or the actual > DB you are using. > > so I ask again > what is not working? > > Pranay Pandey sent the following on 3/23/2009 4:36 AM: >> BJ, > >> Here I am posting my question again for reference from my first email: > >> Please help me in understanding that is it feasible to use one view >> entity as a member entity into another view entity? > >> Thanks & Regards >> -- >> Pranay Pandey > > >> On Mar 23, 2009, at 4:51 PM, BJ Freeman wrote: > >> What seems to be the problem >> what is not working > > >> Pranay Pandey sent the following on 3/23/2009 3:45 AM: >>>>> Here for reference I am posting the view entity which has been created >>>>> and log I got while fetching records. >>>>> >>>>> <view-entity entity-name="OrderItemAndFacilityLocation" >>>>> package-name="org.ofbiz.product.facility" title="Order Item And Facility >>>>> Location View Entity"> >>>>> <member-entity entity-alias="SMT" entity-name="ShipmentMethodType"/> >>>>> <member-entity entity-alias="OISG" entity-name="OrderItemShipGroup"/> >>>>> <member-entity entity-alias="OI" entity-name="OrderItem"/> >>>>> <member-entity entity-alias="PFLV" >>>>> entity-name="ProductFacilityLocationView"/> >>>>> <alias entity-alias="OISG" name="orderId"/> >>>>> <alias entity-alias="OISG" name="shipGroupSeqId"/> >>>>> <alias entity-alias="OISG" name="shipmentMethodTypeId"/> >>>>> <alias entity-alias="OISG" name="carrierPartyId"/> >>>>> <alias entity-alias="OI" name="productId"/> >>>>> <alias entity-alias="OI" name="orderItemSeqId"/> >>>>> <alias entity-alias="PFLV" name="locationSeqId"/> >>>>> <alias entity-alias="PFLV" name="locationTypeEnumId"/> >>>>> <view-link entity-alias="PFLV" rel-entity-alias="OI"> >>>>> <key-map field-name="productId"/> >>>>> </view-link> >>>>> <view-link entity-alias="OI" rel-entity-alias="OISG"> >>>>> <key-map field-name="orderId"/> >>>>> </view-link> >>>>> <view-link entity-alias="OISG" rel-entity-alias="SMT"> >>>>> <key-map field-name="shipmentMethodTypeId"/> >>>>> </view-link> >>>>> <relation type="one-nofk" rel-entity-name="ShipmentMethodType"> >>>>> <key-map field-name="shipmentMethodTypeId"/> >>>>> </relation> >>>>> </view-entity> >>>>> >>>>> >>>>> and log: >>>>> ============================ >>>>> SELECT OISG.ORDER_ID, OISG.SHIP_GROUP_SEQ_ID, >>>>> OISG.SHIPMENT_METHOD_TYPE_ID, OISG.CARRIER_PARTY_ID, OI.PRODUCT_ID, >>>>> OI.ORDER_ITEM_SEQ_ID, PFLV.PFL_LOCATION_SEQ_ID, >>>>> PFLV.FL_LOCATION_TYPE_ENUM_ID FROM (((SELECT PFL.PRODUCT_ID AS >>>>> PFL_PRODUCT_ID, PFL.FACILITY_ID AS PFL_FACILITY_ID, PFL.LOCATION_SEQ_ID >>>>> AS PFL_LOCATION_SEQ_ID, PFL.MINIMUM_STOCK AS PFL_MINIMUM_STOCK, >>>>> PFL.MOVE_QUANTITY AS PFL_MOVE_QUANTITY, FL.LOCATION_TYPE_ENUM_ID AS >>>>> FL_LOCATION_TYPE_ENUM_ID, FL.AREA_ID AS FL_AREA_ID, FL.AISLE_ID AS >>>>> FL_AISLE_ID, FL.SECTION_ID AS FL_SECTION_ID, FL.LEVEL_ID AS FL_LEVEL_ID, >>>>> FL.POSITION_ID AS FL_POSITION_ID FROM OFBIZ.PRODUCT_FACILITY_LOCATION >>>>> PFL INNER JOIN OFBIZ.FACILITY_LOCATION FL ON PFL.FACILITY_ID = >>>>> FL.FACILITY_ID AND PFL.LOCATION_SEQ_ID = FL.LOCATION_SEQ_ID) PFLV INNER >>>>> JOIN OFBIZ.ORDER_ITEM OI ON PFLV.PFL_PRODUCT_ID = OI.PRODUCT_ID) INNER >>>>> JOIN OFBIZ.ORDER_ITEM_SHIP_GROUP OISG ON OI.ORDER_ID = OISG.ORDER_ID) >>>>> INNER JOIN OFBIZ.SHIPMENT_METHOD_TYPE SMT ON >>>>> OISG.SHIPMENT_METHOD_TYPE_ID = SMT.SHIPMENT_METHOD_TYPE_ID WHERE >>>>> (OISG.ORDER_ID = ? AND PFLV.FL_LOCATION_TYPE_ENUM_ID = ? AND >>>>> OI.ORDER_ITEM_SEQ_ID = ?) ORDER BY OI.ORDER_ITEM_SEQ_ID ASC >>>>> ============================= >>>>> >>>>> Thanks & Regards >>>>> -- >>>>> Pranay Pandey >>>>> >>>>> >>>>> On Mar 23, 2009, at 3:51 PM, Pranay Pandey wrote: >>>>> >>>>>> Hello All, >>>>>> >>>>>> Please help me in understanding that is it feasible to use one view >>>>>> entity as a member entity into another view entity? >>>>>> >>>>>> I have tried to do so and saw the log for prepared statement in >>>>>> SQLProcessor.java. Found that there are so many inner joins in the >>>>>> query on console. >>>>>> >>>>>> Thanks in advance for any help. >>>>>> >>>>>> Regards >>>>>> -- >>>>>> Pranay Pandey >>>>>> >>>>>> >>>>>> Version: GnuPG v1.4.6 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJx7+irP3NbaWWqE4RAjvWAJ47BpDup7xUIUyvryMeLFC8bZvj4gCgiCVC Zw2i5RznL5c145zfeq1x0i8= =XUad -----END PGP SIGNATURE----- |
In reply to this post by David E Jones-3
Thanks David, for explanation, clarification.
Kind Regards -- Pranay Pandey On Mar 23, 2009, at 10:01 PM, David E Jones wrote: > > Is it feasible? That depends on the constraints you're working with. > > It does usually work and can be done, but also often results in > asking the database to do more than your code really needs it to do > (ie including things in the joins that you don't need, significantly > slowing performance). The same is true of poorly defined view- > entities with normal (non-view) member entities, but there is more > of a tendency for that with views of views. > > -David > > > On Mar 23, 2009, at 5:36 AM, Pranay Pandey wrote: > >> BJ, >> >> Here I am posting my question again for reference from my first >> email: >> >> Please help me in understanding that is it feasible to use one >> view entity as a member entity into another view entity? >> >> Thanks & Regards >> -- >> Pranay Pandey >> >> >> On Mar 23, 2009, at 4:51 PM, BJ Freeman wrote: >> >>> -----BEGIN PGP SIGNED MESSAGE----- >>> Hash: SHA1 >>> >>> What seems to be the problem >>> what is not working >>> >>> >>> Pranay Pandey sent the following on 3/23/2009 3:45 AM: >>>> Here for reference I am posting the view entity which has been >>>> created >>>> and log I got while fetching records. >>>> >>>> <view-entity entity-name="OrderItemAndFacilityLocation" >>>> package-name="org.ofbiz.product.facility" title="Order Item And >>>> Facility >>>> Location View Entity"> >>>> <member-entity entity-alias="SMT" entity- >>>> name="ShipmentMethodType"/> >>>> <member-entity entity-alias="OISG" entity- >>>> name="OrderItemShipGroup"/> >>>> <member-entity entity-alias="OI" entity-name="OrderItem"/> >>>> <member-entity entity-alias="PFLV" >>>> entity-name="ProductFacilityLocationView"/> >>>> <alias entity-alias="OISG" name="orderId"/> >>>> <alias entity-alias="OISG" name="shipGroupSeqId"/> >>>> <alias entity-alias="OISG" name="shipmentMethodTypeId"/> >>>> <alias entity-alias="OISG" name="carrierPartyId"/> >>>> <alias entity-alias="OI" name="productId"/> >>>> <alias entity-alias="OI" name="orderItemSeqId"/> >>>> <alias entity-alias="PFLV" name="locationSeqId"/> >>>> <alias entity-alias="PFLV" name="locationTypeEnumId"/> >>>> <view-link entity-alias="PFLV" rel-entity-alias="OI"> >>>> <key-map field-name="productId"/> >>>> </view-link> >>>> <view-link entity-alias="OI" rel-entity-alias="OISG"> >>>> <key-map field-name="orderId"/> >>>> </view-link> >>>> <view-link entity-alias="OISG" rel-entity-alias="SMT"> >>>> <key-map field-name="shipmentMethodTypeId"/> >>>> </view-link> >>>> <relation type="one-nofk" rel-entity-name="ShipmentMethodType"> >>>> <key-map field-name="shipmentMethodTypeId"/> >>>> </relation> >>>> </view-entity> >>>> >>>> >>>> and log: >>>> ============================ >>>> SELECT OISG.ORDER_ID, OISG.SHIP_GROUP_SEQ_ID, >>>> OISG.SHIPMENT_METHOD_TYPE_ID, OISG.CARRIER_PARTY_ID, OI.PRODUCT_ID, >>>> OI.ORDER_ITEM_SEQ_ID, PFLV.PFL_LOCATION_SEQ_ID, >>>> PFLV.FL_LOCATION_TYPE_ENUM_ID FROM (((SELECT PFL.PRODUCT_ID AS >>>> PFL_PRODUCT_ID, PFL.FACILITY_ID AS PFL_FACILITY_ID, >>>> PFL.LOCATION_SEQ_ID >>>> AS PFL_LOCATION_SEQ_ID, PFL.MINIMUM_STOCK AS PFL_MINIMUM_STOCK, >>>> PFL.MOVE_QUANTITY AS PFL_MOVE_QUANTITY, FL.LOCATION_TYPE_ENUM_ID AS >>>> FL_LOCATION_TYPE_ENUM_ID, FL.AREA_ID AS FL_AREA_ID, FL.AISLE_ID AS >>>> FL_AISLE_ID, FL.SECTION_ID AS FL_SECTION_ID, FL.LEVEL_ID AS >>>> FL_LEVEL_ID, >>>> FL.POSITION_ID AS FL_POSITION_ID FROM >>>> OFBIZ.PRODUCT_FACILITY_LOCATION >>>> PFL INNER JOIN OFBIZ.FACILITY_LOCATION FL ON PFL.FACILITY_ID = >>>> FL.FACILITY_ID AND PFL.LOCATION_SEQ_ID = FL.LOCATION_SEQ_ID) PFLV >>>> INNER >>>> JOIN OFBIZ.ORDER_ITEM OI ON PFLV.PFL_PRODUCT_ID = OI.PRODUCT_ID) >>>> INNER >>>> JOIN OFBIZ.ORDER_ITEM_SHIP_GROUP OISG ON OI.ORDER_ID = >>>> OISG.ORDER_ID) >>>> INNER JOIN OFBIZ.SHIPMENT_METHOD_TYPE SMT ON >>>> OISG.SHIPMENT_METHOD_TYPE_ID = SMT.SHIPMENT_METHOD_TYPE_ID WHERE >>>> (OISG.ORDER_ID = ? AND PFLV.FL_LOCATION_TYPE_ENUM_ID = ? AND >>>> OI.ORDER_ITEM_SEQ_ID = ?) ORDER BY OI.ORDER_ITEM_SEQ_ID ASC >>>> ============================= >>>> >>>> Thanks & Regards >>>> -- >>>> Pranay Pandey >>>> >>>> >>>> On Mar 23, 2009, at 3:51 PM, Pranay Pandey wrote: >>>> >>>>> Hello All, >>>>> >>>>> Please help me in understanding that is it feasible to use one >>>>> view >>>>> entity as a member entity into another view entity? >>>>> >>>>> I have tried to do so and saw the log for prepared statement in >>>>> SQLProcessor.java. Found that there are so many inner joins in >>>>> the >>>>> query on console. >>>>> >>>>> Thanks in advance for any help. >>>>> >>>>> Regards >>>>> -- >>>>> Pranay Pandey >>>>> >>>>> >>>>> >>>> >>> -----BEGIN PGP SIGNATURE----- >>> Version: GnuPG v1.4.6 (MingW32) >>> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org >>> >>> iD8DBQFJx3DNrP3NbaWWqE4RAoz6AJ9BNX4Y0PQRd90kWGv1KoGQSalAGwCcDt7Z >>> CVCddvLEPo2pt3rGy1S5j64= >>> =02uo >>> -----END PGP SIGNATURE----- >> > smime.p7s (3K) Download Attachment |
Free forum by Nabble | Edit this page |