@Target(value={}) @Retention(value=RUNTIME) public @interface ConstructorResult
SqlResultSetMapping
annotation to map the SELECT clause of a SQL query
to a constructor.
Applies a constructor for the target class, passing in as arguments values from the specified columns. All
columns corresponding to arguments of the intended constructor must be specified using the columns
element of the ConstructorResult
annotation in the same order as that of the argument list of the
constructor. Any entities returned as constructor results will be in either the new or detached state,
depending on whether a primary key is retrieved for the constructed object.
Modifier and Type | Required Element and Description |
---|---|
ColumnResult[] |
columns
(Required) The mapping of columns in the SELECT list to the arguments of the intended constructor, in
order.
|
Class |
targetClass
(Required) The class whose constructor is to be invoked.
|
public abstract Class targetClass
public abstract ColumnResult[] columns
Copyright © 2020. All rights reserved.