SqlParameterSource implementation that obtains parameter values
from bean properties of a given JavaBean object, from component accessors
of a record class, or from raw field access.
This is a more flexible variant of BeanPropertySqlParameterSource,
with the limitation that it is not able to enumerate its
parameter names.
In terms of its fallback property discovery algorithm, this class is
similar to org. which is
also just used for property retrieval purposes (rather than binding).
NamedParameterJdbcTemplate, BeanPropertySqlParameterSource, org.springframework.jdbc.core.simple.JdbcClient.StatementSpec#paramSource(Object) , org.springframework.jdbc.core.SimplePropertyRowMapper
| Modifier and Type | Field and Description |
|---|---|
| private static final Object | |
| private final Object | |
| private final Map |
| Access | Constructor and Description |
|---|---|
| public | SimplePropertySqlParameterSource(Object
the bean, record or field holder instance to wrap paramObject)Create a new SqlParameterSource for the given bean, record or field holder. |
| Modifier and Type | Method and Description |
|---|---|
| private Object | |
| public int | getSqlType(String
the name of the parameter paramName)Overrides org. Overrides default org. |
| public Object | getValue(String
the name of the parameter paramName)Implements org. |
| public boolean | hasValue(String
the name of the parameter paramName)Implements org. |
| NO_DESCRIPTOR | back to summary |
|---|---|
| private static final Object NO_DESCRIPTOR | |
| paramObject | back to summary |
|---|---|
| private final Object paramObject | |
| propertyDescriptors | back to summary |
|---|---|
| private final Map<String, Object> propertyDescriptors | |
| SimplePropertySqlParameterSource | back to summary |
|---|---|
| public SimplePropertySqlParameterSource(Object paramObject) Create a new SqlParameterSource for the given bean, record or field holder.
| |
| getDescriptor | back to summary |
|---|---|
| private Object getDescriptor(String paramName) | |
| getSqlType | back to summary |
|---|---|
| public int getSqlType(String paramName) Overrides org. Overrides default org. Derives a default SQL type from the corresponding property type.
| |
| getValue | back to summary |
|---|---|
| public Object getValue(String paramName) throws IllegalArgumentException Implements org. Doc from org. Return the parameter value for the requested named parameter.
| |
| hasValue | back to summary |
|---|---|
| public boolean hasValue(String paramName) Implements org. Doc from org. Determine whether there is a value for the specified named parameter. | |