Question

JoinType.Cross

Hi Community. 
Has anyone ever tried using the .Join(JoinType.Cross) in their Selects ? 


Can you share any examples ? 

Like 0

Like

6 comments

Hello Yurii.
Here is an example of CrossJoin method usage:
 

var select = new Select(userConnection)

    .Column("City", "Name").As("CityName")

    .Column("Country", "Name").As("CountryName")

    .From("City")

    .CrossJoin("Country");


The resulting query will be:

SELECT
       [City].[Name] [CityName],
      [Country].[Name] [CountryName]
   FROM
        [dbo].[City] WITH(NOLOCK)
    CROSS JOIN [dbo].[Country] WITH(NOLOCK)

You can also find couple of examples of using  Joins in this article


Hope this helps

Yevhenii Grytsiuk,
Thanks for the answer. 
The method .CrossJoin doesn't exist in my enviroment. Is this some kind of method extenstion? 
Also the link to the article doesn't work, I'd appreciate if you fix the link. 

Yevhenii Grytsiuk,

Hi, the provided link is https://the%20resulting%20query%20will%20be/? please correct it

Yurii Sokil,

Thank you for notifying us. The link should be fixed. If not, please check: https://academy.terrasoft.ua/docs/developer/back_end_razrabotka/operatsii_s_dannymi_back_end/orm/obzor#title-3515-5

The CrossJoin method is located in the Select class within the Terrasoft.Core.DB namespace. 

I also received some updates regarding your question from our R&D team. These statements should be identical in terms of expected results:

.Join(JoinType.Cross, Schema.Name) .CrossJoin(Schema.Name).As("SubjectSchema")


However, the following syntax will be hidden in a future version of Creatio - Join(JoinType.Cross, Schema.Name), and using the .CrossJoin method is preferred

Yevhenii Grytsiuk,

Thanks, the link is in Ukranian/Russian, is there some in English?

Julio.Falcon_Nodos,

Hello, sure - https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platform/back-end-development/data-operations-back-end/orm/overview. I didn't realize that this article is available on both of our sites, so excuse me.

Show all comments