Revision 90d49e1d
Added by Andreas Müller almost 2 years ago
cdmlib-cache/src/main/java/eu/etaxonomy/cdm/cache/ProxyUtils.java | ||
---|---|---|
142 | 142 |
* otherwise <code>o</code> is returned. |
143 | 143 |
*/ |
144 | 144 |
public static <T extends Object> T deproxyIfInitialized(T o) { |
145 |
if(o != null && o instanceof HibernateProxy) {
|
|
145 |
if(o instanceof HibernateProxy) { |
|
146 | 146 |
LazyInitializer hli = ((HibernateProxy)o).getHibernateLazyInitializer(); |
147 | 147 |
if(!hli.isUninitialized()) { |
148 | 148 |
@SuppressWarnings("unchecked") |
... | ... | |
151 | 151 |
} |
152 | 152 |
} |
153 | 153 |
|
154 |
if(o != null && o instanceof PersistentCollection) {
|
|
154 |
if(o instanceof PersistentCollection) { |
|
155 | 155 |
PersistentCollection pc = ((PersistentCollection)o); |
156 | 156 |
if(pc.wasInitialized()) { |
157 | 157 |
@SuppressWarnings("unchecked") |
Also available in: Unified diff
cleanup