Project

General

Profile

« Previous | Next » 

Revision 77d3424c

Added by Andreas Kohlbecker over 6 years ago

ref #6867 deproxy hibernate proxys

View differences:

src/main/java/eu/etaxonomy/cdm/persistence/hibernate/GrantedAuthorityRevokingRegistrationUpdateLister.java
22 22
import org.hibernate.event.spi.PostUpdateEventListener;
23 23
import org.hibernate.persister.entity.EntityPersister;
24 24

  
25
import eu.etaxonomy.cdm.hibernate.HibernateProxyHelper;
25 26
import eu.etaxonomy.cdm.model.agent.AgentBase;
26 27
import eu.etaxonomy.cdm.model.agent.Person;
27 28
import eu.etaxonomy.cdm.model.agent.Team;
......
121 122
        if(name == null){
122 123
            return;
123 124
        }
125
        name = HibernateProxyHelper.deproxy(name);
124 126
        deleteCandidates.add(new CdmAuthority(name, UPDATE_DELETE));
125 127
        addDeleteCandidates(deleteCandidates, (Reference)name.getNomenclaturalReference());
126 128
        addDeleteCandidates(deleteCandidates, name.getCombinationAuthorship());
......
138 140
        if(td == null){
139 141
            return;
140 142
        }
143
        td = HibernateProxyHelper.deproxy(td);
141 144
        deleteCandidates.add(new CdmAuthority(td, UPDATE_DELETE));
142 145
        addDeleteCandidates(deleteCandidates, td.getCitation());
143 146
        if(td instanceof SpecimenTypeDesignation){
......
154 157
        if(deriveUnit == null){
155 158
            return;
156 159
        }
160

  
161
        deriveUnit = HibernateProxyHelper.deproxy(deriveUnit);
157 162
        if(deriveUnit.getCollection() != null){
158 163
            deleteCandidates.add(new CdmAuthority(deriveUnit.getCollection(), UPDATE_DELETE));
159 164
        }
......
174 179
        if(fieldUnit == null){
175 180
            return;
176 181
        }
182
        fieldUnit = HibernateProxyHelper.deproxy(fieldUnit);
177 183
        if(fieldUnit.getGatheringEvent() != null){
178 184
            addDeleteCandidates(deleteCandidates, fieldUnit.getGatheringEvent().getActor());
179 185
        }
......
187 193
        if(reference == null){
188 194
            return;
189 195
        }
196
        reference = HibernateProxyHelper.deproxy(reference);
190 197
        deleteCandidates.add(new CdmAuthority(reference, UPDATE_DELETE));
191 198
        addDeleteCandidates(deleteCandidates, reference.getAuthorship());
192 199
        addDeleteCandidates(deleteCandidates, reference.getInReference());
......
196 203
        if(agent == null){
197 204
            return;
198 205
        }
206
        agent = HibernateProxyHelper.deproxy(agent);
199 207
        deleteCandidates.add(new CdmAuthority(agent, UPDATE_DELETE));
200 208
        if(agent instanceof TeamOrPersonBase){
201 209
            if(agent instanceof Team){

Also available in: Unified diff