Module org.jooq
Package org.jooq

Interface Label

All Superinterfaces:
Named, QueryPart, Serializable

@Pro public interface Label extends Named
A label for use in procedural code.

In procedural code, labels can be used to identify a specific Statement within a Block. This is useful for DSL.exit(Label) and DSL.continue_(Label) statments, which allow for control flow within a loop, or DSL.goto_(Label) statements in any other context.

Example:

 // Assuming import static org.jooq.impl.DSL.*;

 Label label = label("label");
 using(configuration)
    .begin(
        label.label(
            for_(i).in(1, 3).loop(
                if_(i.gt(1)).then(exit(label))
            )
        )
    )
    .execute();
 

Instances can be created using DSL.label(Name) and overloads.

Author:
Lukas Eder