Outer join for table B on table A where there is no constraint between the two tables

Hello!

We have this case:
SELECT A.*, B.Text FROM A
LEFT OUTER JOIN B where (A.Value BETWEEN B.Min AND B.Max) And B.TABLENAME = 'A'

There is no constraint or referential integrity between the two tables.
Can we do this? If yes, how?

Cheers!

For JOINS to be added to the SQL, the association must be mapped in Aurelius class. If there is no association, the join cannot be added.

Okay,. so what we're saying is that I need to make a separate call, correct?
If that's so, can I use the existing object manager or do I need a separate one?

Thanks!

What do you mean by separate call? What I say is that Aurelius doesn't add a JOIN to SQL unless the involved class has an association mapped. It only adds JOINs for associations mapped in the entity class.

I mean I still have to get B.TEXT in some way so I am assuming I will have to make a .Find< B >.Where.... to get the right value, correct?

Cheers!

Yes, that's an option. Or just execute an SQL statement.

We're trying to move away from straight SQL statements. Could we use the SQL projection for this in some way?

No, projections are not for joins.

True, but if there were a reasonable way to make it do what we want even as a single SQL statement that would be good too.