0 Replies Latest reply on Oct 13, 2014 6:47 AM by umesh paliwal

    Issue with JPA in wildfly 8.1

    umesh paliwal Newbie

      hi gyus...

       

       

      we are migrating from jboss 5.1 to wildfly 8.1.  There was an entity class which used @CollectionOfElements. This has been replaced with @ElementCollections. the problem is when i am running the code after changing to @CollectionElements, the sql query generated replaces left outer join to inner join.

      and because of this it throws entity definition not found exception..

      Help is sincerelely apprieciated...

       

      Below is the H SQL  generated in Jboss 5.1 :

       

      select

                  modelheade0_.ID as ID234_4_,

                  modelheade0_.LAST_SAVE_USER_NAME as LAST3_234_4_,

                  modelheade0_.LAST_VERSION_STRING as LAST4_234_4_,

                  modelheade0_.NAME as NAME234_4_,

                  modelheade0_.READ_ONLY as READ6_234_4_,

                  modelheade0_.TEMPLATE_ID as TEMPLATE7_234_4_,

                  modelheade0_.DTYPE as DTYPE234_4_,

                  moduletags1_.MODEL_HEADER_ID as MODEL1_6_,

                  moduletags1_.MODULE_TAG as MODULE2_6_,

                  contexttag2_.MODEL_HEADER_ID as MODEL2_7_,

                  cmdbcontex3_.ID as CONTEXT1_7_,

                  cmdbcontex3_.ID as ID243_0_,

                  cmdbcontex3_.NAME as NAME243_0_,

                  deployedsy4_.MODEL_HEADER_ID as MODEL1_8_,

                  neonruntim5_.ID as RT2_8_,

                  neonruntim5_.ID as ID269_1_,

                  neonruntim5_.HOST as HOST269_1_,

                  neonruntim5_.PORT as PORT269_1_,

                  neonruntim5_.ID as ID269_1_,

                  neonruntim5_.HOST as HOST269_1_,

                  neonruntim5_.PORT as PORT269_1_,

                  neonruntim5_.NAME as NAME269_1_,

                  tags6_.MODEL_HEADER_ID as MODEL1_9_,

                  cmdbtag7_.ID as TAG2_9_,

                  cmdbtag7_.ID as ID284_2_,

                  cmdbtag7_.NAME as NAME284_2_,

                  modeltempl8_.ID as ID234_3_,

                  modeltempl8_.LAST_SAVE_USER_NAME as LAST3_234_3_,

                  modeltempl8_.LAST_VERSION_STRING as LAST4_234_3_,

                  modeltempl8_.NAME as NAME234_3_,

                  modeltempl8_.READ_ONLY as READ6_234_3_

              from

                  SOL_MODEL_HEADER modelheade0_

              left outer join

                  SOL_MODEL_MODULE_TAGS moduletags1_

                      on modelheade0_.ID=moduletags1_.MODEL_HEADER_ID

              left outer join

                  SOL_MODEL_CONTEXT_TAG contexttag2_

                      on modelheade0_.ID=contexttag2_.MODEL_HEADER_ID

              left outer join

                  SOL_CONTEXT_TAG cmdbcontex3_

                      on contexttag2_.CONTEXT_TAG_ID=cmdbcontex3_.ID

              left outer join

                  SOL_MH_DEPLOY_SYSTEM deployedsy4_

                      on modelheade0_.ID=deployedsy4_.MODEL_HEADER_ID

              left outer join

                  SOL_RUNTIME_SYSTEMS neonruntim5_

                      on deployedsy4_.RT_SYSTEM_ID=neonruntim5_.ID

              left outer join

                  SOL_MODEL_TAG tags6_

                      on modelheade0_.ID=tags6_.MODEL_HEADER_ID

              left outer join

                  SOL_TAG cmdbtag7_

                      on tags6_.TAG_ID=cmdbtag7_.ID

              left outer join

                  SOL_MODEL_HEADER modeltempl8_

                      on modelheade0_.TEMPLATE_ID=modeltempl8_.ID

              where

                  modelheade0_.ID=11302

       

       

       

      below is the HSQL generated in wildfly :

       

      select

          modelheade0_.ID as ID2_50_0_,

          modelheade0_.LAST_SAVE_USER_NAME as LAST_SAVE_USER_NAM3_50_0_,

          modelheade0_.LAST_VERSION_STRING as LAST_VERSION_STRIN4_50_0_,

          modelheade0_.NAME as NAME5_50_0_,

          modelheade0_.READ_ONLY as READ_ONLY6_50_0_,

          modelheade0_.TEMPLATE_ID as TEMPLATE_ID7_50_0_,

          modelheade0_.DTYPE as DTYPE1_50_0_,

          moduletags1_.MODEL_HEADER_ID as MODEL_HEADER_ID1_50_1_,

          moduletags1_.MODULE_TAG as MODULE_TAG2_51_1_,

          contexttag2_.MODEL_HEADER_ID as MODEL_HEADER_ID2_50_2_,

          cmdbcontex3_.ID as CONTEXT_TAG_ID1_47_2_,

          cmdbcontex3_.ID as ID1_16_3_,

          cmdbcontex3_.NAME as NAME2_16_3_,

          deployedsy4_.MODEL_HEADER_ID as MODEL_HEADER_ID1_50_4_,

          neonruntim5_.ID as RT_SYSTEM_ID2_45_4_,

          neonruntim5_.ID as ID1_75_5_,

          neonruntim5_.HOST as HOST2_75_5_,

          neonruntim5_.PORT as PORT3_75_5_,

          neonruntim5_.NAME as NAME4_75_5_,

          tags6_.MODEL_HEADER_ID as MODEL_HEADER_ID1_50_6_,

          cmdbtag7_.ID as TAG_ID2_58_6_,

          cmdbtag7_.ID as ID1_81_7_,

          cmdbtag7_.NAME as NAME2_81_7_,

          modeltempl8_.ID as ID2_50_8_,

          modeltempl8_.LAST_SAVE_USER_NAME as LAST_SAVE_USER_NAM3_50_8_,

          modeltempl8_.LAST_VERSION_STRING as LAST_VERSION_STRIN4_50_8_,

          modeltempl8_.NAME as NAME5_50_8_,

          modeltempl8_.READ_ONLY as READ_ONLY6_50_8_

      from

          SOL_MODEL_HEADER modelheade0_

      left outer join

          SOL_MODEL_MODULE_TAGS moduletags1_

              on modelheade0_.ID=moduletags1_.MODEL_HEADER_ID

      left outer join

          SOL_MODEL_CONTEXT_TAG contexttag2_

              on modelheade0_.ID=contexttag2_.MODEL_HEADER_ID

      left outer join

          SOL_CONTEXT_TAG cmdbcontex3_

              on contexttag2_.CONTEXT_TAG_ID=cmdbcontex3_.ID

      left outer join

          SOL_MH_DEPLOY_SYSTEM deployedsy4_

              on modelheade0_.ID=deployedsy4_.MODEL_HEADER_ID

      left outer join

          SOL_RUNTIME_SYSTEMS neonruntim5_

              on deployedsy4_.RT_SYSTEM_ID=neonruntim5_.ID

      left outer join

          SOL_MODEL_TAG tags6_

              on modelheade0_.ID=tags6_.MODEL_HEADER_ID

      left outer join

          SOL_TAG cmdbtag7_

              on tags6_.TAG_ID=cmdbtag7_.ID

      inner join                         ============================================> Inner join replaced

          SOL_MODEL_HEADER modeltempl8_

              on modelheade0_.TEMPLATE_ID=modeltempl8_.ID

      where

          modelheade0_.ID=11302