Class JdbcQueryParameter

java.lang.Object
com.northconcepts.datapipeline.foundations.core.Bean
com.northconcepts.datapipeline.foundations.jdbc.JdbcQueryParameter
All Implemented Interfaces:
DataExceptionContributor, JsonSerializable, RecordSerializable, XmlSerializable, Serializable

public class JdbcQueryParameter extends Bean
A ? parameter of a JdbcQuery: its name, Java and SQL types, and an expression giving the example value bound when JdbcConnection.loadQueries() runs the query.
See Also:
  • Field Details

  • Constructor Details

    • JdbcQueryParameter

      public JdbcQueryParameter()
    • JdbcQueryParameter

      public JdbcQueryParameter(String name, Class<?> javaType, Integer sqlType, String exampleValueExpression)
  • Method Details

    • getName

      public String getName()
    • getNameAsJavaIdentifier

      public String getNameAsJavaIdentifier()
      Returns the name as a camel-case Java identifier, e.g. firstName for FIRST_NAME.
    • setName

      public JdbcQueryParameter setName(String name)
    • getJavaType

      public Class<?> getJavaType()
    • setJavaType

      public JdbcQueryParameter setJavaType(Class<?> javaType)
    • getSqlType

      public Integer getSqlType()
      Returns the java.sql.Types code used to bind the example value, or null to let the driver infer it.
    • setSqlType

      public void setSqlType(Integer sqlType)
      Sets the java.sql.Types code used to bind the example value, or null to let the driver infer it.
    • getExampleValueExpression

      public String getExampleValueExpression()
      Returns the DataPipeline expression whose result, converted to the Java type, is the example value; null means a null value.
    • setExampleValueExpression

      public JdbcQueryParameter setExampleValueExpression(String exampleValueExpression)
      Sets the DataPipeline expression whose result, converted to the Java type, is the example value; null means a null value.
    • getExampleValue

      public Object getExampleValue() throws Throwable
      Evaluates the example value expression and converts the result to the Java type; returns null if there is no expression.
      Throws:
      Throwable
    • toRecord

      public Record toRecord()
      Description copied from interface: RecordSerializable
      Converts this object's state to a record that RecordSerializable.fromRecord(Record) can load.
      Specified by:
      toRecord in interface RecordSerializable
      Overrides:
      toRecord in class Bean
    • fromRecord

      public JdbcQueryParameter fromRecord(Record source)
      Description copied from interface: RecordSerializable
      Loads this instance's state from a record and returns this (for fluid API call chaining). For fluid API call chaining, the overridden method should change the declared return type to its class.
      Specified by:
      fromRecord in interface RecordSerializable
      Overrides:
      fromRecord in class Bean
      Parameters:
      source -
      Returns:
      this instance.