org.sqlproc.engine.impl
Class SqlInputValue

java.lang.Object
  extended by org.sqlproc.engine.impl.SqlInputValue

 class SqlInputValue
extends java.lang.Object

The entity for a dynamic input value.

Author:
Vladimir Hudec

Nested Class Summary
(package private) static class SqlInputValue.Case
          Enumeration for no/upper/lower case conversion.
 
Field Summary
private  SqlInputValue.Case caseConversion
          Which conversion should be done on inputValue.
private  java.lang.Object inputValue
          A dynamic input value.
private  java.lang.String likeChar
          A wildcard character for SQL statement like.
(package private)  org.slf4j.Logger logger
          The internal slf4j logger.
private  int minLikeLength
          The minimum length of inputValue to enable likeChar special treatment.
private  SqlType type
          Dynamic input value type.
 
Constructor Summary
SqlInputValue(java.lang.Object inputValue, SqlInputValue.Case caseConversion, SqlType type)
          Creates a new instance of this entity.
 
Method Summary
private  java.lang.String processLike(java.lang.Object val)
          A special treatment of dynamic input value for SQL statement like.
(package private)  void setLike(java.lang.String likeChar, java.lang.Integer minLikeLength)
          Sets a special treatment of dynamic input value
(package private)  void setQueryParam(org.hibernate.SQLQuery query, java.lang.String paramName)
          Bind a dynamic input value to a named query parameter.
 java.lang.String toString()
          For debug purposes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

logger

final org.slf4j.Logger logger
The internal slf4j logger.


caseConversion

private SqlInputValue.Case caseConversion
Which conversion should be done on inputValue.


inputValue

private java.lang.Object inputValue
A dynamic input value.


likeChar

private java.lang.String likeChar
A wildcard character for SQL statement like. It can be added to inputValue as a prefix and/or as a suffix.


minLikeLength

private int minLikeLength
The minimum length of inputValue to enable likeChar special treatment.


type

private SqlType type
Dynamic input value type.

Constructor Detail

SqlInputValue

SqlInputValue(java.lang.Object inputValue,
              SqlInputValue.Case caseConversion,
              SqlType type)
Creates a new instance of this entity. Used from inside ANTLR parser.

Parameters:
inputValue - a dynamic input value
caseConversion - which conversion should be done on inputValue
type - a type of dynamic input value
Method Detail

setQueryParam

void setQueryParam(org.hibernate.SQLQuery query,
                   java.lang.String paramName)
Bind a dynamic input value to a named query parameter.

Parameters:
query - the object-oriented representation of a Hibernate query
paramName - the name of the parameter

setLike

void setLike(java.lang.String likeChar,
             java.lang.Integer minLikeLength)
Sets a special treatment of dynamic input value

Parameters:
likeChar - a wildcard character
minLikeLength - the minimum length of inputValue to enable likeChar special treatment

processLike

private java.lang.String processLike(java.lang.Object val)
A special treatment of dynamic input value for SQL statement like.

Parameters:
val - the dynamic input value
Returns:
a dynamic input value with a likeChar as a prefix and/or suffix

toString

public java.lang.String toString()
For debug purposes.

Overrides:
toString in class java.lang.Object
Returns:
a String representation for a debug output


Copyright © 2010. All Rights Reserved.