spring-framework / org.springframework.jdbc.core.namedparam / BeanPropertySqlParameterSource

BeanPropertySqlParameterSource

open class BeanPropertySqlParameterSource : AbstractSqlParameterSource

SqlParameterSource implementation that obtains parameter values from bean properties of a given JavaBean object. The names of the bean properties have to match the parameter names.

Uses a Spring BeanWrapper for bean property access underneath.

Author
Thomas Risberg

Author
Juergen Hoeller

Since
2.0

See Also
NamedParameterJdbcTemplateorg.springframework.beans.BeanWrapper

Constructors

<init>

BeanPropertySqlParameterSource(object: Any)

Create a new BeanPropertySqlParameterSource for the given bean.

Functions

getReadablePropertyNames

open fun getReadablePropertyNames(): Array<String>

Provide access to the property names of the wrapped bean. Uses support provided in the PropertyAccessor interface.

getSqlType

open fun getSqlType(paramName: String): Int

Derives a default SQL type from the corresponding property type.

getValue

open fun getValue(paramName: String): Any

hasValue

open fun hasValue(paramName: String): Boolean