java.lang.Object
java.lang.Record
org.litebridge.orm.engine.ast.InsertNode
- Record Components:
table- name of the table to insert intodtoClass- class of the DTO to insertcontextDtoClass- The parent/context DTO class for determining the correctdtoClasstable mapping (for shared DTOs mapped to multiple distinct tables)columns- names of the columns to insert intoexpressionSpecs- expressions to use instead of columns
- All Implemented Interfaces:
QueryNode
public record InsertNode(@Nullable String table, @Nullable Class<?> dtoClass, @Nullable Class<?> contextDtoClass, String @Nullable [] columns, ExpressionSpec @Nullable [] expressionSpecs)
extends Record
implements QueryNode
Represents an INSERT statement in the query AST.
This is a root node.
-
Constructor Summary
ConstructorsConstructorDescriptionInsertNode(@Nullable String table, @Nullable Class<?> dtoClass, @Nullable Class<?> contextDtoClass, String @Nullable [] columns, ExpressionSpec @Nullable [] expressionSpecs) Creates an instance of aInsertNoderecord class.InsertNode(@Nullable String table, @Nullable Class<?> dtoClass, String[] columns) Creates a newInsertNodeinstance with column names.InsertNode(@Nullable String table, @Nullable Class<?> dtoClass, ExpressionSpec[] expressionSpecs) Creates a newInsertNodeinstance with expression specifications. -
Method Summary
Modifier and TypeMethodDescriptionString @Nullable []columns()Returns the value of thecolumnsrecord component.@Nullable Class<?> Returns the value of thecontextDtoClassrecord component.@Nullable Class<?> dtoClass()Returns the value of thedtoClassrecord component.booleanIndicates whether some other object is "equal to" this one.ExpressionSpec @Nullable []Returns the value of theexpressionSpecsrecord component.inthashCode()Returns a hash code value for this object.@Nullable QueryNodeprevious()Returns the previous node in the chain, ornullif this is the root node.@Nullable Stringtable()Returns the value of thetablerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
InsertNode
Creates a newInsertNodeinstance with column names.- Parameters:
table- the target table name, ornulldtoClass- the target DTO class, ornullcolumns- the column names to insert into
-
InsertNode
public InsertNode(@Nullable String table, @Nullable Class<?> dtoClass, ExpressionSpec[] expressionSpecs) Creates a newInsertNodeinstance with expression specifications.- Parameters:
table- the target table name, ornulldtoClass- the target DTO class, ornullexpressionSpecs- the expression specifications to insert
-
InsertNode
public InsertNode(@Nullable String table, @Nullable Class<?> dtoClass, @Nullable Class<?> contextDtoClass, String @Nullable [] columns, ExpressionSpec @Nullable [] expressionSpecs) Creates an instance of aInsertNoderecord class.- Parameters:
table- the value for thetablerecord componentdtoClass- the value for thedtoClassrecord componentcontextDtoClass- the value for thecontextDtoClassrecord componentcolumns- the value for thecolumnsrecord componentexpressionSpecs- the value for theexpressionSpecsrecord component
-
-
Method Details
-
previous
Description copied from interface:QueryNodeReturns the previous node in the chain, ornullif this is the root node. -
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). -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
table
Returns the value of thetablerecord component.- Returns:
- the value of the
tablerecord component
-
dtoClass
Returns the value of thedtoClassrecord component.- Returns:
- the value of the
dtoClassrecord component
-
contextDtoClass
Returns the value of thecontextDtoClassrecord component.- Returns:
- the value of the
contextDtoClassrecord component
-
columns
Returns the value of thecolumnsrecord component.- Returns:
- the value of the
columnsrecord component
-
expressionSpecs
Returns the value of theexpressionSpecsrecord component.- Returns:
- the value of the
expressionSpecsrecord component
-