I have a table GD_CODE with 2 columns (PrimaryKey)
For this table a have a class
This table is referenced from other clases per example in this way
All is fine but if in some records for A the GD_CODEID is NULL when querying for the A class a unnecessary SELECT is done to retrieve the GenericCode, that is not neccessary as the GD_CODEID is NULL so won't be a relation.
This is performance problem when there are too many record in A that have GD_CODEID as NULL
Is there anyway to avoid this unncessary SELECTS ?