Record Class NamedSQLListParameter
java.lang.Object
java.lang.Record
cool.scx.jdbc.sql.NamedSQLListParameter
代表一种特殊的 SQL 参数类型, 用于处理带有列表形式的命名参数.
通常用于 SQL 查询中, 如 IN 子句 例如: `SELECT * FROM table WHERE field IN (:values)`` 该类允许用户将多个值传递给 SQL 查询, 而不是仅仅传递一个单一值.
注意: 此参数类型只能用于带有命名参数的 SQL 查询, 且仅适用于 NamedSQL.
示例:
var inList = new NamedSQLListParameter(1, 2, 3, 4);
对应 SQL 查询: SELECT * FROM table WHERE field IN (:inList)
- Version:
- 0.0.1
- Author:
- scx567888
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionNamedSQLListParameter(Collection<?> values) Creates an instance of aNamedSQLListParameterrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.static NamedSQLListParameterstatic NamedSQLListParameterof(Collection<?> values) final StringtoString()Returns a string representation of this record class.Collection<?> values()Returns the value of thevaluesrecord component.
-
Constructor Details
-
NamedSQLListParameter
Creates an instance of aNamedSQLListParameterrecord class.- Parameters:
values- the value for thevaluesrecord component
-
-
Method Details
-
of
-
of
-
toString
-
hashCode
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
values
Returns the value of thevaluesrecord component.- Returns:
- the value of the
valuesrecord component
-