You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instanceof doesn't always work with Hibernate proxies, but sometimes it does.
As a precaution I recommend to use getType() instead when it's implemented like in Datasets & DatasetAcquisition, or use Hibernate.getClass() which return the real class, proxy or not.
We should do that with every instanceof to any @entity in the code.
ie : if (dataset instanceof MrDataset)
should be if(DatasetType.Mr.equals(dataset.getType()))
or Hibernate.getClass(ds).equals(MrDataset.class)
The text was updated successfully, but these errors were encountered:
Instanceof doesn't always work with Hibernate proxies, but sometimes it does.
As a precaution I recommend to use getType() instead when it's implemented like in Datasets & DatasetAcquisition, or use Hibernate.getClass() which return the real class, proxy or not.
We should do that with every instanceof to any @entity in the code.
ie :
if (dataset instanceof MrDataset)
should be
if(DatasetType.Mr.equals(dataset.getType()))
or
Hibernate.getClass(ds).equals(MrDataset.class)
The text was updated successfully, but these errors were encountered: