This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Build ServiceRegistry | |
--------------------- | |
Map config = ...; | |
A) ServiceRegistry serviceRegistry = | |
new ServiceRegistryBuilder( config ) | |
... | |
.buildServiceRegistry(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MetadataImpl constructor: | |
public MetadataImpl(MetadataSources metadataSources, ProcessingOrder preferredProcessingOrder) { | |
this.serviceRegistry = metadataSources.getServiceRegistry(); | |
this.namingStrategy = metadataSources.getNamingStrategy(); | |
final ArrayList<String> processedEntityNames = new ArrayList<String>(); | |
if ( preferredProcessingOrder == ProcessingOrder.HBM_FIRST ) { | |
applyHibernateMappings( metadataSources, processedEntityNames ); | |
applyAnnotationMappings( metadataSources, processedEntityNames ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) MetadataSources -> Metadata -> SessionFactory process | |
[HHH-6107] - Metamodel dependence on ServiceRegistry (Steve: done) | |
[HHH-6138] - Implement addition of annotated classes and packages in MetadataSources (Steve: done) | |
[HHH-6141] - Develop scheme for ordered processing of MetadataSources sources (Steve: done) | |
A) for HBM XML | |
[HHH-2578] - redesign SessionFactory building (Steve: done) | |
[HHH-6145] - Create an "xml binding" service (Steve: open) | |
B) for EM | |
[HHH-6149] - Clean up EJB3Configuration (Steve: open) | |
[HHH-6159] - Determine best way to handle EntityManagerFactory building |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HHH-6227 will provide a way to update Entity/Attribute objects in EntityBinding/AttributeBinding objects | |
EntityBinding entityBinding = | |
new EntityBinding( name ) | |
.initialize( new HbmEntityBindingState( getHibernateMappingBinder(), ... ) | |
.initialize( new HbmEntityRelationalState( getHibernateMappingBinder(), ... ); | |
entityBinding.setEntity( new Entity( name ) ) can be called immediately or later | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In the new metamodel code, it appears that both "Attribute" and "Value" bindings are modelled using AttributeBinding. The places I've seen references to "Value" bindings (EntityIdentifier, Discriminator) don't necessarily have a domain representation. | |
I'm working on @IdClass, and this an example where the IdClass itself does not have a representation in the domain model. | |
I'd like to make some improvements. | |
NOTE: This uses POJO terminology; this applies to other entity modes as well. | |
EntityBinding knows about 3 different kinds of bindings: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
How should persisters get property type (i.e. o.h.type.Type)? | |
Alternatives: | |
1) in MetamodelImpl: new MetamodelTypeResolver( this ).resolve(); | |
2) in persisters: attributeBinding.getType( typeResolver ); | |
- typeResolver would be the TypeResolver scoped to the SessionFactory |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IIRC, an entity can only exist in one entity mode per SessionFactory. | |
If this is correct, then o.h.metamodel.domain.Entity does not need: | |
private final PojoEntitySpecifics pojoEntitySpecifics = new PojoEntitySpecifics(); | |
private final Dom4jEntitySpecifics dom4jEntitySpecifics = new Dom4jEntitySpecifics(); | |
private final MapEntitySpecifics mapEntitySpecifics = new MapEntitySpecifics(); | |
It only needs: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Hibernate, Relational Persistence for Idiomatic Java | |
* | |
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as | |
* indicated by the @author tags or express copyright attribution | |
* statements applied by the authors. All third-party contributions are | |
* distributed under license by Red Hat Inc. | |
* | |
* This copyrighted material is made available to anyone wishing to use, modify, | |
* copy, or redistribute it subject to the terms and conditions of the GNU |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public ClassHolder getOrCreateClassHolder(String className) { | |
ClassHolder classHolder = classHoldersByName.get( className ); | |
if ( classHolder == null ) { | |
classHolder = ClassHolderImpl.createDeferredClassHolder( className, classLoaderService() ); | |
classHoldersByName.put( className, classHolder ); | |
} | |
return classHolder; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Hibernate, Relational Persistence for Idiomatic Java | |
* | |
* Copyright (c) 2011, Red Hat Inc. or third-party contributors as | |
* indicated by the @author tags or express copyright attribution | |
* statements applied by the authors. All third-party contributions are | |
* distributed under license by Red Hat Inc. | |
* | |
* This copyrighted material is made available to anyone wishing to use, modify, | |
* copy, or redistribute it subject to the terms and conditions of the GNU |
OlderNewer