micronaut-data icon indicating copy to clipboard operation
micronaut-data copied to clipboard

Properties annotated with JPA transient should not be excluded from introspections by default

Open lcavadas opened this issue 3 years ago • 4 comments

…ntrospections by default

This fixes the consequences from https://github.com/micronaut-projects/micronaut-core/pull/8072 and was done following https://github.com/micronaut-projects/micronaut-core/discussions/8052

Determining the persistent properties by filtering by the introspection properties that do not have the Transient annotation.

lcavadas avatar Sep 22 '22 15:09 lcavadas

CLA assistant check
All committers have signed the CLA.

CLAassistant avatar Sep 22 '22 15:09 CLAassistant

We would need to filter out transient properties somehow. Maybe there can be a new method isTransient.

dstepanov avatar Sep 23 '22 09:09 dstepanov

Actually, after looking at the code for a bit, it was already there... When the code cycles through the bean properties it already has a check to continue if the property is transient.

example: https://github.com/micronaut-projects/micronaut-data/blob/master/data-model/src/main/java/io/micronaut/data/model/runtime/RuntimePersistentEntity.java#L83-L85

lcavadas avatar Sep 23 '22 12:09 lcavadas

All in all I found 3 locations where this would make a difference and they all seemed to already have a check to ignore Transient properties.

lcavadas avatar Sep 23 '22 12:09 lcavadas

@dstepanov I've been using the version built from this commit (in conjunction with the change on micronaut-core) for about a week now and it seems to work fine with jdbc & hibernate. I have had issues with the @Transactional support (in data-tx) but it doesn't seem related to these changes (the logs seem to indicate a recursive bean injection issue).

Not sure if you've had a chance to take any meaningful look at this but I also have no clue why the checks are failing here since they seem to run fine on my local environment. The logs on github actions shows the following error ##[error]❌ Failed to create checks using the provided token. (HttpError: Resource not accessible by integration).

In any case, to wrap up this already long message, is there anything I can do to help you out here?

lcavadas avatar Sep 28 '22 08:09 lcavadas

@graemerocher, @dstepanov

It seems you're getting ready to release version 4.0. Can we please get a resolution on this?

Thanks!

lcavadas avatar Jun 02 '23 14:06 lcavadas

Can you please rebase the PR?

dstepanov avatar Jun 05 '23 16:06 dstepanov

Hi @dstepanov, just rebased to master. Sorry I thought this project was using the same approach as Micronaut-core but from the other PRs I gather that you actually want to merge to master instead of 4.0.x. I've rebased to master and changed the PR base to master.

Let me know if this is not what you intended and I'll fix it ASAP (I am on CET time)

lcavadas avatar Jun 05 '23 20:06 lcavadas

I have corrected and added more tests.

dstepanov avatar Jun 06 '23 14:06 dstepanov