Top Description Inners Fields Constructors Methods
org.jooq.impl

pack-priv final Class Diff

extends Object
Class Inheritance
Static Imports
java.lang.Boolean.FALSE, java.util.Arrays.asList, org.jooq.SQLDialect.IGNITE, .SQLDialect.MARIADB, .SQLDialect.MYSQL, org.jooq.impl.Comparators.CHECK_COMP, .Comparators.FOREIGN_KEY_COMP, .Comparators.INDEX_COMP, .Comparators.KEY_COMP, .Comparators.NAMED_COMP, .ConstraintType.CHECK, .ConstraintType.FOREIGN_KEY, .ConstraintType.PRIMARY_KEY, .ConstraintType.UNIQUE, .Tools.NO_SUPPORT_TIMESTAMP_PRECISION, .Tools.allMatch, .Tools.anyMatch, org.jooq.tools.StringUtils.defaultIfNull, .StringUtils.defaultString, .StringUtils.isEmpty

A class producing a diff between two Meta objects.
Author
Lukas Eder

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static interface
Diff.Create<N extends Named>

private static record
private static interface
Diff.Drop<N extends Named>

private static interface
Diff.Merge<N extends Named>

Field Summary

Modifier and TypeField and Description
private final DSLContext
private final DDL
private final DDLExportConfiguration
private final Diff.Merge<Table<?>>
private final Meta
private final Meta
private final MigrationConfiguration
private static final Set<SQLDialect>

Constructor Summary

AccessConstructor and Description
pack-priv
Diff(Configuration configuration, MigrationConfiguration migrateConf, Meta meta1, Meta meta2)

Method Summary

Modifier and TypeMethod and Description
private final <N extends Named> Diff.DiffResult
append(Diff.DiffResult result, List<? extends N> l1, List<? extends N> l2, Comparator<? super N> comp, Diff.Create<N> create, Diff.Drop<N> drop, Diff.Merge<N> merge)

private final <N extends Named> Diff.DiffResult
append(Diff.DiffResult result, List<? extends N> l1, List<? extends N> l2, Comparator<? super N> comp, Diff.Create<N> create, Diff.Drop<N> drop, Diff.Merge<N> merge, boolean dropMergeCreate)

private final Diff.DiffResult
private final Diff.DiffResult
appendChecks(Diff.DiffResult result, Table<?> t1, List<? extends Check<?>> c1, List<? extends Check<?>> c2)

private final Diff.DiffResult
appendChecks(Diff.DiffResult result, Domain<?> d1, List<? extends Check<?>> c1, List<? extends Check<?>> c2)

private final Diff.DiffResult
appendColumns(Diff.DiffResult result, Table<?> t1, List<? extends Field<?>> l1, List<? extends Field<?>> l2)

private final Diff.DiffResult
appendDomains(Diff.DiffResult result, List<? extends Domain<?>> l1, List<? extends Domain<?>> l2)

private final Diff.DiffResult
appendForeignKeys(Diff.DiffResult result, final Table<?> t1, List<? extends ForeignKey<?, ?>> fk1, List<? extends ForeignKey<?, ?>> fk2)

private final Diff.DiffResult
appendIndexes(Diff.DiffResult result, Table<?> t1, List<? extends Index> l1, List<? extends Index> l2)

private final Diff.DiffResult
appendPrimaryKey(Diff.DiffResult result, final Table<?> t1, List<? extends UniqueKey<?>> pk1, List<? extends UniqueKey<?>> pk2)

private final Diff.DiffResult
private final Diff.DiffResult
appendSequences(Diff.DiffResult result, List<? extends Sequence<?>> l1, List<? extends Sequence<?>> l2)

private final Diff.DiffResult
appendTables(Diff.DiffResult result, List<? extends Table<?>> l1, List<? extends Table<?>> l2)

private final Diff.DiffResult
appendUniqueKeys(Diff.DiffResult result, final Table<?> t1, List<? extends UniqueKey<?>> uk1, List<? extends UniqueKey<?>> uk2)

private final Diff.Create<Table<?>>
private final Diff.Drop<Sequence<?>>
private final Diff.Drop<Table<?>>
private final boolean
isSynthetic(Field<?> f)

Deprecated as a consequence of Field being deprecated.
private final boolean
private final <K extends Named> Diff.Merge<K>
keyMerge(Table<?> t1, Diff.Create<K> create, Diff.Drop<K> drop, ConstraintType type)

private final <K extends Named> Diff.Merge<K>
keyMerge(Domain<?> d1, Diff.Create<K> create, Diff.Drop<K> drop)

pack-priv final Queries
private final List<UniqueKey<?>>
removePrimary(List<? extends UniqueKey<?>> list)

private static final <N extends Named> Iterator<N>
sorted(List<N> list, Comparator<? super N> comp)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

ctxback to summary
private final DSLContext ctx
ddlback to summary
private final DDL ddl
exportConfback to summary
private final DDLExportConfiguration exportConf
MERGE_TABLEback to summary
private final Diff.Merge<Table<?>> MERGE_TABLE
meta1back to summary
private final Meta meta1
meta2back to summary
private final Meta meta2
migrateConfback to summary
private final MigrationConfiguration migrateConf
NO_SUPPORT_PK_NAMESback to summary
private static final Set<SQLDialect> NO_SUPPORT_PK_NAMES

Constructor Detail

Diffback to summary
pack-priv Diff(Configuration configuration, MigrationConfiguration migrateConf, Meta meta1, Meta meta2)

Method Detail

appendback to summary
private final <N extends Named> Diff.DiffResult append(Diff.DiffResult result, List<? extends N> l1, List<? extends N> l2, Comparator<? super N> comp, Diff.Create<N> create, Diff.Drop<N> drop, Diff.Merge<N> merge)
appendback to summary
private final <N extends Named> Diff.DiffResult append(Diff.DiffResult result, List<? extends N> l1, List<? extends N> l2, Comparator<? super N> comp, Diff.Create<N> create, Diff.Drop<N> drop, Diff.Merge<N> merge, boolean dropMergeCreate)
appendCatalogsback to summary
private final Diff.DiffResult appendCatalogs(Diff.DiffResult result, List<Catalog> l1, List<Catalog> l2)
appendChecksback to summary
private final Diff.DiffResult appendChecks(Diff.DiffResult result, Table<?> t1, List<? extends Check<?>> c1, List<? extends Check<?>> c2)
appendChecksback to summary
private final Diff.DiffResult appendChecks(Diff.DiffResult result, Domain<?> d1, List<? extends Check<?>> c1, List<? extends Check<?>> c2)
appendColumnsback to summary
private final Diff.DiffResult appendColumns(Diff.DiffResult result, Table<?> t1, List<? extends Field<?>> l1, List<? extends Field<?>> l2)
appendDomainsback to summary
private final Diff.DiffResult appendDomains(Diff.DiffResult result, List<? extends Domain<?>> l1, List<? extends Domain<?>> l2)
Annotations
@SuppressWarnings:unchecked, rawtypes
appendForeignKeysback to summary
private final Diff.DiffResult appendForeignKeys(Diff.DiffResult result, final Table<?> t1, List<? extends ForeignKey<?, ?>> fk1, List<? extends ForeignKey<?, ?>> fk2)
appendIndexesback to summary
private final Diff.DiffResult appendIndexes(Diff.DiffResult result, Table<?> t1, List<? extends Index> l1, List<? extends Index> l2)
appendPrimaryKeyback to summary
private final Diff.DiffResult appendPrimaryKey(Diff.DiffResult result, final Table<?> t1, List<? extends UniqueKey<?>> pk1, List<? extends UniqueKey<?>> pk2)
appendSchemasback to summary
private final Diff.DiffResult appendSchemas(Diff.DiffResult result, List<Schema> l1, List<Schema> l2)
appendSequencesback to summary
private final Diff.DiffResult appendSequences(Diff.DiffResult result, List<? extends Sequence<?>> l1, List<? extends Sequence<?>> l2)
appendTablesback to summary
private final Diff.DiffResult appendTables(Diff.DiffResult result, List<? extends Table<?>> l1, List<? extends Table<?>> l2)
appendUniqueKeysback to summary
private final Diff.DiffResult appendUniqueKeys(Diff.DiffResult result, final Table<?> t1, List<? extends UniqueKey<?>> uk1, List<? extends UniqueKey<?>> uk2)
createTableback to summary
private final Diff.Create<Table<?>> createTable()
dropSequenceback to summary
private final Diff.Drop<Sequence<?>> dropSequence()
dropTableback to summary
private final Diff.Drop<Table<?>> dropTable()
isSyntheticback to summary
private final boolean isSynthetic(Field<?> f)

Deprecated

as a consequence of Field being deprecated. See corresponding docs for further information.

isSyntheticback to summary
private final boolean isSynthetic(UniqueKey<?> pk)
keyMergeback to summary
private final <K extends Named> Diff.Merge<K> keyMerge(Table<?> t1, Diff.Create<K> create, Diff.Drop<K> drop, ConstraintType type)
keyMergeback to summary
private final <K extends Named> Diff.Merge<K> keyMerge(Domain<?> d1, Diff.Create<K> create, Diff.Drop<K> drop)
queriesback to summary
pack-priv final Queries queries()
removePrimaryback to summary
private final List<UniqueKey<?>> removePrimary(List<? extends UniqueKey<?>> list)
sortedback to summary
private static final <N extends Named> Iterator<N> sorted(List<N> list, Comparator<? super N> comp)
org.jooq.impl back to summary

private Interface Diff.Create<N extends org.jooq.Named>


Method Summary

Modifier and TypeMethod and Description
public void
create(Diff.DiffResult result, N named)

Method Detail

createback to summary
public void create(Diff.DiffResult result, N named)
org.jooq.impl back to summary

private final Record Diff.DiffResult

extends Record
Class Inheritance
Record Components
queries:List<Query> 
droppedFks:Set<ForeignKey<?, ?>> 

Field Summary

Modifier and TypeField and Description
private final Set<ForeignKey<?, ?>>
droppedFks

Record Component accessed by droppedFks().

private final List<Query>
queries

Record Component accessed by queries().

Constructor Summary

AccessConstructor and Description
pack-priv
private
DiffResult(List<Query> queries, Set<ForeignKey<?, ?>> droppedFks)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
public Set<ForeignKey<?, ?>>
droppedFks()

Record Component getter of droppedFks.

public final boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.
public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.
public List<Query>
queries()

Record Component getter of queries.

public String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

droppedFksback to summary
private final Set<ForeignKey<?, ?>> droppedFks

Record Component accessed by droppedFks().

queriesback to summary
private final List<Query> queries

Record Component accessed by queries().

Constructor Detail

DiffResultback to summary
pack-priv DiffResult()
DiffResultback to summary
private DiffResult(List<Query> queries, Set<ForeignKey<?, ?>> droppedFks)

Method Detail

addAllback to summary
pack-priv void addAll(Diff.DiffResult other)
droppedFksback to summary
public Set<ForeignKey<?, ?>> droppedFks()

Record Component getter of droppedFks.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

queriesback to summary
public List<Query> queries()

Record Component getter of queries.

toStringback to summary
public String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

Returns:String

a string representation of the object.

Annotations
@Override
org.jooq.impl back to summary

private Interface Diff.Drop<N extends org.jooq.Named>


Method Summary

Modifier and TypeMethod and Description
public void
drop(Diff.DiffResult result, N named)

Method Detail

dropback to summary
public void drop(Diff.DiffResult result, N named)
org.jooq.impl back to summary

private Interface Diff.Merge<N extends org.jooq.Named>


Method Summary

Modifier and TypeMethod and Description
public void
merge(Diff.DiffResult result, N named1, N named2)

Method Detail

mergeback to summary
public void merge(Diff.DiffResult result, N named1, N named2)