2019-08-15 20:24:16 -04:00
|
|
|
= Mapping model
|
|
|
|
|
2020-08-25 21:17:35 -04:00
|
|
|
The mapping model encompasses the complete mapping of objects to/from database. It is the
|
|
|
|
model used to drive read and write operations.
|
|
|
|
|
|
|
|
[NOTE]
|
|
|
|
----
|
|
|
|
As of 6.0, only read operations are implemented to use this mapping model. Future versions will hopefully
|
|
|
|
move writing to use this mapping model as well
|
|
|
|
----
|
|
|
|
|
|
|
|
[plantuml,MasppingTypeSystem,png]
|
|
|
|
.Mapping type model (org.hibernate.metamodel.mapping)
|
2019-08-15 20:24:16 -04:00
|
|
|
....
|
|
|
|
@startuml
|
|
|
|
skinparam handwritten true
|
|
|
|
|
|
|
|
interface MappingType
|
2020-08-25 21:17:35 -04:00
|
|
|
interface ManagedMappingType
|
2019-08-15 20:24:16 -04:00
|
|
|
|
2022-01-23 10:32:43 -05:00
|
|
|
interface MappingModelExpressible
|
2019-08-15 20:24:16 -04:00
|
|
|
interface ValueMapping
|
|
|
|
interface BasicType
|
|
|
|
interface ModelPart
|
|
|
|
interface ModelPartContainer
|
|
|
|
|
2020-08-25 21:17:35 -04:00
|
|
|
MappingType <|-- BasicType
|
|
|
|
MappingType <|-- JdbcMapping
|
|
|
|
MappingType <|-- ManagedMappingType
|
|
|
|
MappingType <|-- CollectionMappingType
|
|
|
|
|
|
|
|
ManagedMappingType <|-- EmbeddableMappingType
|
|
|
|
ManagedMappingType <|-- EntityMappingType
|
|
|
|
|
2022-01-23 10:32:43 -05:00
|
|
|
MappingModelExpressible <|-- ValueMapping
|
|
|
|
MappingModelExpressible <|-- ModelPart
|
2019-08-15 20:24:16 -04:00
|
|
|
|
|
|
|
ValueMapping <|-- BasicType
|
2020-08-25 21:17:35 -04:00
|
|
|
|
|
|
|
ModelPart <|-- BasicValuedModelPart
|
|
|
|
ModelPart <|-- EmbeddableValuedModelPart
|
|
|
|
ModelPart <|-- EntityValuedModelPart
|
2019-08-15 20:24:16 -04:00
|
|
|
ModelPart <|-- AttributeMapping
|
|
|
|
ModelPart <|-- EntityIdentifierMapping
|
|
|
|
ModelPart <|-- EntityVersionMapping
|
|
|
|
ModelPart <|-- EntityDiscriminatorMapping
|
2020-08-25 21:17:35 -04:00
|
|
|
ModelPart <|-- CollectionPart
|
2019-08-15 20:24:16 -04:00
|
|
|
|
2020-08-25 21:17:35 -04:00
|
|
|
ModelPartContainer <|-- EntityMappingType
|
|
|
|
ModelPartContainer <|-- EmbeddableMappingType
|
2019-08-15 20:24:16 -04:00
|
|
|
|
|
|
|
@enduml
|
|
|
|
....
|
|
|
|
|
|
|
|
== Relationship with legacy "persister walking" SPI
|
|
|
|
|
|
|
|
`org.hibernate.metamodel.model.mapping` contract corollaries in `org.hibernate.persister.walking`:
|
|
|
|
|
|
|
|
EntityMapping::EntityDefinition
|
|
|
|
EmbeddableMapping::CompositionDefinition
|
|
|
|
AttributeMapping::AttributeDefinition
|
|
|
|
EntityIdentifierMapping::EntityIdentifierDefinition
|
|
|
|
|
|
|
|
|
|
|
|
== AllowableParameterType
|
|
|
|
|
2022-01-10 13:25:08 -05:00
|
|
|
`BindableType` is a contract that defines types that are valid for parameter binding in terms of an SQM query.
|
2019-08-15 20:24:16 -04:00
|
|
|
|
|
|
|
AT some point this needs to be "resolved" to a ValueMapping/Type/Bindable when generating the SQL AST and executing.
|
|
|
|
|
2022-01-23 10:32:43 -05:00
|
|
|
One option is to have the `BindableType` be resolved first to a `SqmExpressible`
|
|
|
|
`SqmExpressibleAllowableParameterType#resolveSqmExpressible`
|