Package com.onec.migration
Record Class MigrationContext
java.lang.Object
java.lang.Record
com.onec.migration.MigrationContext
public record MigrationContext(org.jdbi.v3.core.Handle handle, MetadataRegistry registry, SqlDialect dialect)
extends Record
Everything an
AppMigration gets to work with: a JDBI Handle bound to the
transaction the migration (and its history record) runs in, the metadata registry for
resolving table/column names from entity metadata, and the active SQL dialect.-
Constructor Summary
ConstructorsConstructorDescriptionMigrationContext(org.jdbi.v3.core.Handle handle, MetadataRegistry registry, SqlDialect dialect) Creates an instance of aMigrationContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondialect()Returns the value of thedialectrecord component.final booleanIndicates whether some other object is "equal to" this one.voidConvenience shortcut forhandle().execute(sql).org.jdbi.v3.core.Handlehandle()Returns the value of thehandlerecord component.final inthashCode()Returns a hash code value for this object.registry()Returns the value of theregistryrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
MigrationContext
public MigrationContext(org.jdbi.v3.core.Handle handle, MetadataRegistry registry, SqlDialect dialect) Creates an instance of aMigrationContextrecord class.- Parameters:
handle- the value for thehandlerecord componentregistry- the value for theregistryrecord componentdialect- the value for thedialectrecord component
-
-
Method Details
-
execute
Convenience shortcut forhandle().execute(sql). -
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. All components in this record class are compared withObjects::equals(Object,Object). -
handle
public org.jdbi.v3.core.Handle handle()Returns the value of thehandlerecord component.- Returns:
- the value of the
handlerecord component
-
registry
Returns the value of theregistryrecord component.- Returns:
- the value of the
registryrecord component
-
dialect
Returns the value of thedialectrecord component.- Returns:
- the value of the
dialectrecord component
-