java.lang.Object
com.foreach.across.modules.hibernate.util.DtoUtils

public class DtoUtils extends Object
Author:
Arne Vandamme
  • 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.