Class DtoUtils
java.lang.Object
com.foreach.across.modules.hibernate.util.DtoUtils
- Author:
- Arne Vandamme
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> T
createDto
(T entity) Attempts to create a default dto for an object by creating a new instance and copying all properties.
-
Method Details
-
createDto
public static <T> T createDto(T entity) Attempts to create a default dto for an object by creating a new instance and copying all properties. This requires the entity type to have a parameterless constructor.Will throw a runtime exception if anything goes wrong.
- Type Parameters:
T
- Entity type.- Parameters:
entity
- Original entity.- Returns:
- New instance with the same properties or null if the original was null.
-