Revision 25b120ed
Added by Andreas Müller almost 2 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/ref/TypedEntityReference.java | ||
---|---|---|
69 | 69 |
} |
70 | 70 |
} |
71 | 71 |
|
72 |
public static <T extends CdmBase> TypedEntityReference<T> fromEntityWithLabel(T entity, String explicitLabel) { |
|
73 |
if(entity == null) { |
|
74 |
return null; |
|
75 |
} |
|
76 |
entity = HibernateProxyHelper.deproxy(entity); |
|
77 |
return new TypedEntityReference<>((Class<T>)entity.getClass(), entity.getUuid(), explicitLabel); |
|
78 |
} |
|
79 |
|
|
72 | 80 |
/** |
73 | 81 |
* Casts the <code>TypedEntityReference</code> to the <code>subType</code> if possible. |
74 | 82 |
* |
Also available in: Unified diff
ref #10089 handle RegistrationDTO with TypedEntityReference again in cdmlib