-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exclude the properties market as _metadata_ #208
Comments
Here are some examples about exclusion, that should point you in the right direction. The one in line 48 seems like the most promising one for your scenario. |
However, I'm not sure you really want to diff the |
Thanks Daniel. Yes I would like to ignore whole of SessionFactory object. I did try to do it by setting the exclusion type to SessionFactoryImpl.class but it didn’t work. |
It has been ages since I've used Hibernate, so I'm just guessing here, but could it be that the |
It’s other way. SessionFactoryImpl is implementation of SessionFactory. I noticed in your example “objectDifferBuilder.inclusion().exclude().type(ArrayList)”, Do we need to say ArrayList.class? |
Hi Daniel, I fixed the issue by adding following exclusions:
Any reason what has changed? |
Glad it works now. It's hard to tell what has changed. Didn't Hibernate have some kind of mechanism to attach and detach objects from it? Maybe your object is in detached state and wasn't before? It's really hard to say without seeing your code. And even then it might be some strange little detail. Looking at the reported circular references I'm kinda worried, your object might not be the best target for the object differ. Especially |
How can I exclude the properties marked as metadata? I keep getting the exception with message "java.lang.UnsupportedOperationException: org.hibernate.SessionFactory.getAllClassMetadata is no longer supported" on propertyname "allClassMetadata" and source is org.hibernate.internal.SessionFactoryImpl.
In fact ideally I would want to exclude all the fields from SessionFactoryImpl class. I have tried many ways but fails to achieve the result.
The text was updated successfully, but these errors were encountered: