-
Hi, we have custom, strongly typed/named id wrappers that are registered in Hibernate via We just started using entity views and we are getting this error:
but Furthermore (and strangely), for some other entities that are referenced from
If we add I debugged |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 19 replies
-
Besides, this reads as if equals/hashCode covering just the respective id should be enough (since no embeddable is involved here):
but it enforces all fields to be included regardless. |
Beta Was this translation helpful? Give feedback.
-
Hi, can you share some sample code? Usually, I would recommend you to use embedded ids instead of
I assume this might have to do with the use of
The thing is, any non-basic or non-entity-view type usage for an attribute within an entity view can lead to problems if the equals/hashCode of that type is not proper.
That's true in general, but I really need to see a sample to better understand what is going on :) |
Beta Was this translation helpful? Give feedback.
-
I debugged a bit (i am a coworker of @famod). Some validation is done during blazebit bootup, which finally leads to the error message above. I think this is the section causing the error:
[...]
Now, our constructor does nothing in respect of setting ids. We do this by lombok builders like:
So whatever hibernate-known id generation code you call, it will not supply a valid entity with an id. In fact, the debugger showed that both entity instances have Is there a way to disable this particular automatic sanity-check (besides |
Beta Was this translation helpful? Give feedback.
-
@beikov WDYT about this short-term remedy? public class MyEntityViewConfigurationProvider extends EntityViewConfigurationProviderImpl {
@Override
public EntityViewConfiguration createConfiguration() {
final var cfg = super.createConfiguration();
cfg.setProperty(ConfigurationProperties.MANAGED_TYPE_VALIDATION_DISABLED, "true");
return cfg;
}
} Plus service loader file. Seems to work in a QuarkusTest (have yet to check the other setups). |
Beta Was this translation helpful? Give feedback.
@beikov WDYT about this short-term remedy?
Plus service loader file.
Seems to work in a QuarkusTest (have yet to check the other setups).