java.lang.Object
java.lang.Record
org.litebridge.orm.nativesql.ParsedSql
- Record Components:
sql- the SQL statement with named parameters replaced by positional placeholdersbindValueCount- the number of bind values in the statementbindValueNames- a list of the original names of the bind parameters in the order they appear in the statement
Represents a parsed SQL statement with positional parameters and their corresponding names.
This class encapsulates a SQL statement where named parameters are replaced with positional placeholders (e.g., "?") and provides a list of the original parameter names. It is used for transforming SQL statements with named parameters into a format that can be executed using standard JDBC APIs.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintReturns the value of thebindValueCountrecord component.Returns the value of thebindValueNamesrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.sql()Returns the value of thesqlrecord component.final StringtoString()Returns a string representation of this record class.booleanChecks if the SQL statement uses named bind parameters.
-
Constructor Details
-
ParsedSql
Creates an instance of aParsedSqlrecord class.- Parameters:
sql- the value for thesqlrecord componentbindValueCount- the value for thebindValueCountrecord componentbindValueNames- the value for thebindValueNamesrecord component
-
-
Method Details
-
usesNamedBindParameters
public boolean usesNamedBindParameters()Checks if the SQL statement uses named bind parameters.- Returns:
trueif the SQL contains named bind parameters;falseotherwise.
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
sql
Returns the value of thesqlrecord component.- Returns:
- the value of the
sqlrecord component
-
bindValueCount
public int bindValueCount()Returns the value of thebindValueCountrecord component.- Returns:
- the value of the
bindValueCountrecord component
-
bindValueNames
Returns the value of thebindValueNamesrecord component.- Returns:
- the value of the
bindValueNamesrecord component
-