I’ve got a parent-child relationship with the lazy attribute set false, so when I get the parent class with a query I obtain his children too.
It is usually preferable to load everything, parent-children, but in one case I need not to do this.
Is there a way to avoid fetch the children when I get the parent without altering the lazy=false relationship?
No, it’s not possible. The only thing you can do if you just have one case where the association must not be fetched is to use a DTO instead of your entity, and use projections to retrieve only what you want: