|
|
|
|
|
|
Unfortunately the incredible plan that was designed while the development team was meeting in Stockholm a few years back has been lost. So I'll try to re-construct an new awesome plan/design here :)
The general idea is to: # (optional) build a {{BootstrapServiceRegistry}} # (~ optional) build a {{StandardServiceRegistry}} # instantiate a {{MetadataSources}} object, and tell it about the sources for mapping information # build a {{Metadata}} object (representing processed metadata sources). We get here along a few possible paths, depending on what non-default behavior/settings should be used: ** {{MetadataSources#buildMetadata()}} - uses all defaults for building the {{Metadata}}. What about connection info, or other information we really need? To be fair we don't really *need* the JDBC connection info here; its just nice because we can use it (knowing the dialect) for automatically handling certain mapping stuff (quoting keywords e.g.) ** {{MetadataSources#getMetadataBuilder()}} - used to obtain a {{MetadataBuilder}} that can further control the {{Metadata}} building process. ** {{MetadataSources#getMetadataBuilder(StandardServiceRegistry)}} - used to obtain a {{MetadataBuilder}} that can further control the {{Metadata}} building process given a specific {{StandardServiceRegistry}} # build a SessionFactory via {{Metadata#buildSessionFactory}}
----
* {{MetadataSourcesContributor}} - Contract for contributing sources to {{MetadataSources}}. Called by {{MetadataBuilder}}. Adds sources after those explicitly added through {{MetadataSources}} * {{MetadataContributor}} - Contract for contributing bindings to {{Metadata}}. Called by {{Metadata}}. Called after {{MetadataSources}} have been processed (so it has access to the bindings from sources). Envers uses this. * {{ServiceContributor}} - Contract for contributing services. Called by {{StandardServiceRegistryBuilder}} * {{TypeContributor}} - Contract for contributing types. Called by {{Metadata}}. {{Dialect}} is also an implicit {{TypeContributor}} (spatial makes use of this to register db specific geo mapping types).
|
|
|
|
|
|