Skip to content

Conversation

@Migushthe2nd
Copy link

@Migushthe2nd Migushthe2nd commented Nov 15, 2021

This is related to the (closed) issue #8. This PR implements my proposal of a @SelectAlways() decorator for columns.

I found that if using, for example, an @AfterLoad() that depends on fields in the entity, it would be cleaner to use a decorator instead of manually adding addSelects for the fields (like you suggested). I originally considered to encapsulate the PerchQuerybuilder.generateQueryBuilder() with a custom function in order to add the selects, however, I don't think it is ideal to hardcode a list of fields that should be selected, thus this PR.

This implementation only force-selects the column when its class relation is in the query:

parent (in query)
     child (not in query)
          property (not selected)

parent (in query)
     child (in query)
          property (selected)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant