Class TupleConverter<T>
java.lang.Object
in.co.akshitbansal.springwebquery.tupleconverter.TupleConverter<T>
- Type Parameters:
T- target DTO type
- All Implemented Interfaces:
org.springframework.core.convert.converter.Converter<jakarta.persistence.Tuple,T>
public class TupleConverter<T>
extends Object
implements org.springframework.core.convert.converter.Converter<jakarta.persistence.Tuple,T>
Converts JPA
Tuple results into DTO instances by invoking a matching
constructor discovered for the target DTO type.
Constructor selection is delegated to the supplied
PreferredConstructorDiscoverer. Once a matching constructor has been
found for the first tuple shape seen by this converter, that constructor is
cached on the converter instance for subsequent conversions.
-
Constructor Details
-
TupleConverter
public TupleConverter()
-
-
Method Details
-
convert
Converts one tuple into the configured DTO type.- Specified by:
convertin interfaceorg.springframework.core.convert.converter.Converter<jakarta.persistence.Tuple,T> - Parameters:
tuple- tuple to convert- Returns:
- instantiated DTO
- Throws:
QueryConfigurationException- if no suitable constructor can be found or invocation fails
-