API stability¶
model-query is at 0.16.0. Until 1.0.0 the public API may change in any minor release, and the commit that does it is marked breaking. From 1.0.0 the project follows Semantic Versioning.
Today: everything is @Incubating¶
In 0.x every public top-level type is marked @Incubating, the annotations, @EngineFacing, the processor class and
the jpa.vendor types included; only @Incubating itself is not. The API is complete and tested, but it may still
change.
japicmp is configured in the build, but it is skipped until a 1.0.0 baseline exists. The API review for 1.0 already
changed some signatures in 0.2.0; see "Upgrading from 0.1" in the
changelog.
Planned to freeze at 1.0¶
At 1.0 the following is planned to freeze, so that it changes incompatibly only in a new major release and japicmp
fails the build on such a change:
- every annotation except
@UpdateModel,@InsertModelandQueryModel.generateChanges; - every public type of
model-query-coreexcept the bulk-write and insert types andNullPrecedenceRenderer; - in
model-query-jpa,ModelQueryExecutor,ModelQueryConfig,KeysetNullKeys,MysqlStreamingModeandDatabaseVendor, apart from their bulk-write and insert members; - the Spring modules, including the starter's property keys, apart from
ModelQueryRepository.update,delete,insert,insertReturningKeysandpersist,ModelQueryExecutorDecoratorandExecutorContext, and themodelquery.bulk-write.*properties; OrderedColumnConverterand the two built-in timestamp converters, because generated code links them;- the shape of the generated code, except
changes(),update(...),delete(),insert(...),insertFrom(...)andpersist(...).
Filters and Having are already sealed, so a new operator can be added without breaking implementers.
Still incubating after 1.0¶
These stay @Incubating at 1.0, and freeze in a later 1.x minor once one minor ships with no change to them:
- the bulk-write types in
core:ModelUpdate,ModelDelete,Changes,Assignment,ChunkOptions,ChunkedWriteExceptionandPersistenceContextMode, and the bulk-write members of the types above; @UpdateModel,@InsertModel,QueryModel.generateChangesand the generatedchanges(),update(...),delete(),insert(...),insertFrom(...)andpersist(...);- the vendor SPI in
jpa.spi:VendorProfile,ProviderSupportandChunkTransactions; HibernateProviderSupport,NullPrecedenceRenderer, and the bean-validation constraintValidChangeswith itsValidChangesValidator.
Bulk writes are described in Bulk writes.
The insert types are new in 0.3.0 and @Incubating (D-116), and join the bulk-write types in that list. The freeze
review moves to the milestone after 0.4.0, which waits for the adopter to run 0.4.0 in production (D-111, D-118). The
incubating insert types are:
- in
core:ModelInsert,ValuesInsert,ModelPersist,InsertColumnsandConflictUpdate; - the
@InsertModelannotation, and the generatedinsert,insertFromandpersistbuilders; - in
model-query-jpa: the executor'sinsert,insertReturningKeysandpersistmethods, theconflictUpdateWhereOnAssignedColumnsoption ofModelQueryConfig, and injpa.spiInsertSupport,InsertTarget,IdGenerationandConflictClause, withVendorProfile.maxValuesRows()andconflictTargetHonoured(); - in the Spring modules:
ModelQueryRepository.insert,insertReturningKeysandpersist.
Inserts are described in Inserts.
The entity-write types are new in 0.4.0 and @Incubating (D-118), and join the bulk-write types in that list. They are:
- in
core:throughEntities()on the options stage and each resumable stage ofModelUpdateandModelDelete; - in
model-query-jpa:ModelQueryExecutor.persist(persist, returning),WriteAssignment,WriteKindandModelQueryConfig.writeAssignments; - in the Spring modules:
ModelQueryRepository.persist(persist, returning), and the starter's hand-over of everyWriteAssignmentbean to the config.
ModelUpdate.entityMode, buildEntityLoad, assignedAttributes and assignedValues, ModelDelete.entityMode and
buildEntityLoad, ModelQuery.checkReturning and mapReturning, and ModelInsert.conflictUpdateAdds are
@EngineFacing, so not API. Entity writes are described in
Bulk writes.
The selected-field members are new in 0.5.0 and @Incubating (D-120), and join the list above. They are the
@Selected annotation, SelectSet.contains and SelectSet.selectedIn; SelectSet's set-semantics equals, hashCode
and toString are not marked and freeze with SelectSet. The freeze review moves to the milestone after 0.5.0. See
Selected fields.
The field-index members are new in 0.6.0 and @Incubating (D-121), and join the list above. They are FieldIndex, its
Builder and Resolution, AggregateField.named, and the generated fields() method of every query model. See
Client-chosen fields.
The single-row and insert-from-query-model members are new in 0.7.0 and @Incubating (D-123), and join the list above.
They are ModelQueryExecutor.one, first and one(q, key), @QueryModel.generateInserts with the generated
INSERT_COLUMNS, insert, insertFrom and persist it adds to a query model, and ModelQueryRepository.findOne,
findFirst and findByKey. The executor methods are abstract, not defaults, so a class that implements
ModelQueryExecutor itself must add them. See
One model for reading and creating and
Reading one row.
The insert-column and multi-key members are new in 0.8.0 and @Incubating (D-125, D-126), and join the list above.
They are the @ExcludeFromInserts annotation and the generateInserts rules that leave out a non-writable
@Generated column, ModelQueryExecutor.byKeys and ModelQueryRepository.findAllByKeys. byKeys is abstract, not a
default, so a class that implements ModelQueryExecutor itself must add it. PrimaryKey.attributeKey is
@EngineFacing, so it is not API. See
One model for reading and creating and
Reading many keys.
The row-lock members are new in 0.9.0 and @Incubating (D-127), and join the list above. They are RowLock and its
Wait, ModelQuery.Builder#lock, ModelQuery#lock() and ModelQuery#withLock; ProviderSupport#locks() returns an
Optional<LockSupport>, and both are in jpa.spi, @Incubating and not @EngineFacing, so a provider implements
them as an extension point. See Row locks.
The literal-filter and bound-argument members are new in 0.9.0 and @Incubating (D-128), and join the list above.
They are the fixed-arity Filters#in and #notIn field forms, Condition#operands() with Condition.Kind#IN_FIELDS and #NOT_IN_FIELDS, the two- and three-operand
FilterMatchers#in and #notIn overloads of model-query-test, Expr.constant(ColumnField, Object) and
Expr.value(Object), and ConstantRenderer, the capability ProviderSupport#constants(EntityManagerFactory) returns
in jpa.spi; ConstantRenderer sits in core, is not @EngineFacing, and a provider implements it as an extension
point. The public ModelUpdate.Rendered and ModelDelete.Rendered records, EntityLoad (what buildEntityLoad returns)
and JoinContext#statementParameters() are
@EngineFacing, so not API. See Literal filters.
The returning-write and conflict-extension members are new in 0.9.0 and @Incubating (D-129), and join the list above.
They are the three returning writes, updateReturning, deleteReturning and insertReturning, on ModelQueryExecutor
and on ModelQueryRepository; ConflictUpdate#setExpression with ConflictExpression and Assignment.Conflict; the
KeyedConflict stage with its arbiter where, and ValuesInsert#onConstraint; Expr.nextval with the
SequenceRenderer capability ProviderSupport#sequences(EntityManagerFactory) returns; ReturningSupport,
ReturningShape and WriteStatement in jpa.spi with ProviderSupport#returning() and
VendorProfile#returning(WriteStatement); and the VendorProfile facts conflictOnConstraint(),
conflictArbiterPredicate() and sequences(). The jpa.spi capabilities are extension points of a provider and a
vendor profile, not @EngineFacing. See Returning the changed rows,
Conflict clauses and Sequence values.
The write-expression members are new in 0.9.0 and @Incubating (D-130), and join the list above: the
setExpression(column, ExpressionField) overloads on ModelUpdate.Builder, ConflictUpdate,
ConflictUpdate.Assigned, ValuesInsert.Rows and ModelInsert.Mapping, the Assignment.Computed permit, and
InsertSupport's six-argument insertValues in jpa.spi, a default that refuses a computed value with MQ1613
where a provider does not override it. The new permit means an exhaustive switch over Assignment needs another
case. ModelUpdate#checkSequences, ModelInsert#checkSequences and ModelInsert#computedValues are @EngineFacing.
See Sequence values.
The modelquery.jspecify processor option and the JSpecify annotations it puts on generated code are new in 0.9.0
and incubating (D-135): the option name, the set of annotations and where they go may change in a minor release. The modelquery.aggregating processor option is new in 0.9.0 and incubating too (D-140). See
Processor options.
ProviderSupport.foreignKeyColumn, the ForeignKeyColumn enum in com.rey.modelquery.jpa.spi and core's
ForeignKeyLookup are new in 0.9.0 and incubating (D-136): the answers LOCAL_COLUMN, JOINS and UNKNOWN may change
in a minor release. A provider module that does not override the method answers UNKNOWN, so a bulk write of a
to-one's id is refused with MQ1004.
The portability module is new in 0.9.0 and incubating (D-133, D-139): model-query-portability with Target (Target.of)
and PortabilityCheck and the kinds of result it reports, and ProviderSupport#offlineProperties(DatabaseVendor) in
jpa.spi. The target-vendor members are incubating too: ModelQueryConfig.targetVendors(...), targetVendors() and
checkTargets(EntityManagerFactory), and ProviderSupport.factoryName(EntityManagerFactory). See
Portability.
The source-model members are new in 0.10.0 and incubating (D-143, D-144, D-145, D-147), and join the list above: the
@SourceModel, @Window, @Discriminator and @Depth annotations with WindowFunction and WindowFrame, core's
SourceQuery with its Builder (including tree(...)), WindowField and the RecursiveStep, StepBuilder
and RecursiveKeys a recursive step is written with, plus the TableField.source, ColumnField.over,
ModelQuery#source() and three-argument ModelQuery.builder members and the generated source(),
query(SourceQuery<S>) and WindowField constants. SourceFeature in jpa.spi is an extension point for providers
and vendor profiles, alongside ProviderSupport#sources(), VendorProfile#sources(SourceFeature)
and VendorProfile#maxRecursionDepth(). SetOperation, WindowSpec, SourceRenderer, RecursiveCte, RecursiveSpec
and RecursiveTerm are @EngineFacing, so not API. RecursiveSpec.tree and RecursiveCte.duplicateKey (D-147)
are @Incubating; RecursiveCte is a record a provider constructs, and a tree needs its duplicateKey.
SourceFeature.RECURSIVE_COMPOSITE_KEY (D-149) is also @Incubating. See Source models.
The report-SQL and entity-join members are new in 0.11.0 and @Incubating (D-185 to D-196), and join the list above:
SourceJoin with ModelQuery.Builder#joinSource, EntityJoin with joinEntity, ModelQuery.Builder#joinFilter,
the @JoinSource, @JoinSources, @SourceColumn, @JoinEntity and @JoinEntities annotations, FilterDefinition
with AggregateField#filter, Agg.firstBy, Agg.avgExact, Agg.round and Expr.round, and the notDistinctFrom,
distinctFrom, notDistinctFromColumn and distinctFromColumn filters. SourceRenderer#join, EntityJoinRenderer,
AggregateRenderer, AggregateFeature, AggregateGate, NullSafeEqualityRenderer, RowCounts and
JoinContext#readsThroughOuterJoin are @EngineFacing, so not API.
The column-anchored entity-join and request-bound value members are new in 0.11.0 and @Incubating (D-197 to D-202),
and join the list above: QueryParam, Expr.param, bind on ModelQuery.Builder and SourceQuery.Builder,
EntityJoin#when, the widened EntityJoin.on(column, idAttribute), @JoinEntity.When and @JoinEntity.On#column,
and @Aggregate#entityJoin. ModelQuery#definitionKey() is @Incubating and @EngineFacing: for executors, not
applications. See
Joining an entity,
request-bound values and
aggregating a joined entity.
The key-group members are new in 0.12.0 and @Incubating (D-204 to D-212), and join the list above: KeyGroups
with by, byComposite, bind, groupWhen, verifyMissing and assumeInRange, GroupingRule,
ChildQuery#keyGroups and ModelQuery.Builder#keyGroups. ModelQuery#buildQuery(cb, phase, options, perRound) is
now public and @EngineFacing, so not API. See
child loads over partitioned tables and key groups on a partitioned table.
The nested-join members are new in 0.13.0 and @Incubating (D-213 to D-220), and join the list above:
@Join#entityJoin, JoinScope with of, entity and source, Row.scoped(JoinScope), EntityJoin#within and
SourceJoin#within, and TableField#presentBy on a joined-entity root. See
entity-join chains and
nested models with their own joins.
The recorded-call members are new in 0.14.0 and @Incubating through 1.0 (D-222 to D-226): in
model-query-portability, CallRecorder, RecordedCall, TransactionState, PortabilityCheck#replay and
#leaveOut, and PortabilityCheck.of(PersistenceUnitInfo, ModelQueryConfig); in model-query-spring-data,
ModelQueryExecutorDecorator and ExecutorContext; in model-query-jpa, ForwardingModelQueryExecutor and the
ProviderSupport default dialectVersion(EntityManagerFactory). A method added to ModelQueryExecutor gets a
forwarder in ForwardingModelQueryExecutor in the same release, so a decorator that extends it keeps compiling. See
record and replay calls.
The select-audit module is new in 0.15.0, test-scope and @Incubating (D-228 to D-244): AuditAgent, AuditObserver,
AuditLauncherSessionListener, UnselectedColumnRead, SelectAuditReport and the modelquery.selectAudit.*
properties. ReadAccess is public only because hooked model classes call it and is not API. See
Select audit.
The element-collection members are new in 0.16.0 and @Incubating (D-245 to D-263): ValueChildField,
MapChildField, ValueChildQuery, MapChildQuery, FetchPlan#values and FetchPlan#map, the @ElementModel
annotation, ColumnField.element and, in model-query-test, QueryAssert#values, QueryAssert#map,
ValueChildAssert and MapChildAssert. The
executor-facing ValueLoad and MapLoad are @EngineFacing. See Values and maps.
The fetch-plan types are new in 0.2.0, @Incubating, and not yet placed in the 1.0 freeze list above:
FetchPlan, ChildField, JoinField, ChildQuery, Enricher and the @Child annotation. The executor-facing
ChildLoad and JoinPlan are @EngineFacing. See Fetch plans.
Also new in 0.2.0, @Incubating and not yet in the freeze list: ModelQueryException, the two-way keyset
page (KeysetSpec, KeysetSlice), sub-selects (SubSelect, Outer), expressions (Expr, ExpressionField,
ScalarField, ExpressionDefinition and the @Computed annotation), ModelQueryRepositoryFragmentFactoryBean and
ChildQueryAssert. The keyset cursor's KeysetCursorCodec is @EngineFacing. See
Sub-queries and expressions.
The model-binding annotations are new in 0.9.0 and @Incubating (D-134, D-140, D-141, D-142), and join the list above.
They are @BindQueryModel, @BindUpdateModel, @BindInsertModel and @BindExpression, and the containers of the repeatable three, with @Computed.value
defaulting to void.class, and the MQ3023 to MQ3026 diagnostics. Their members, the names of the generated
classes and the bound-model rules may change in a minor release. See
Models in an API module.
Not API¶
Two things are not API, whatever their visibility, and may change in any release:
- Everything in
com.rey.modelquery.jpa.vendor: the built-in vendor profiles,VendorResolverandResolvedVendor. To support another database, implement thejpa.spiextension points instead. - Types and methods marked
@EngineFacing, which only an executor calls:BuiltQuery,RowSelection,RenderOptions,ChildLoad,JoinPlan,KeysetCursorCodec,JoinContext.ofandOrderField.toOrders.
japicmp ignores @Incubating, @EngineFacing and jpa.vendor.