Skip to content

Commit f5461bd

Browse files
dmealingclaude
andcommitted
docs(core-spring): document Spring Boot starter + metaobjects.omdb.* properties; finish OSGi removal
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent b54f385 commit f5461bd

3 files changed

Lines changed: 29 additions & 8 deletions

File tree

server/java/core-spring/README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,29 @@
22

33
This module provides comprehensive Spring Framework integration for MetaObjects, including auto-configuration, dependency injection, and Spring Boot support.
44

5+
## Spring Boot starter
6+
7+
Add the single starter dependency:
8+
9+
<dependency>
10+
<groupId>com.metaobjects</groupId>
11+
<artifactId>metaobjects-spring-boot-starter</artifactId>
12+
<version>7.1.1-SNAPSHOT</version>
13+
</dependency>
14+
15+
On Spring Boot 3, this auto-configures the metadata-loader registry and — when a
16+
`DataSource` is present — a transaction-aware `ObjectManagerDB`.
17+
18+
Properties:
19+
20+
| Property | Default | Description |
21+
|---|---|---|
22+
| `metaobjects.metadata-sources` | (none) | Loader source URIs/resources. |
23+
| `metaobjects.omdb.dialect` | (auto) | `postgres`/`mysql`/`mssql`/`oracle`/`derby`. Auto-detected from the DataSource when blank. |
24+
| `metaobjects.omdb.enforce-transaction` | `false` | Require an active transaction for writes. |
25+
26+
Define your own `ObjectManagerDB` bean to opt out of the autoconfigured one.
27+
528
## 🚀 **Quick Start**
629

730
### **Add Dependency**
@@ -416,7 +439,7 @@ Optional<MetaObject> user = metaDataService.findMetaObjectByNameOptional("User")
416439
- Thread-safe for concurrent access
417440

418441
### **Memory Management**
419-
- Uses WeakHashMap patterns for OSGi compatibility
442+
- Uses WeakHashMap patterns to avoid leaking classloaders
420443
- Automatic cleanup when Spring context shuts down
421444
- Minimal memory overhead for Spring integration
422445

server/java/core-spring/src/main/java/com/metaobjects/spring/MetaDataService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* Spring Service wrapper for MetaData operations.
1515
*
1616
* <p>Provides a clean, convenient API for the most common MetaData operations
17-
* while hiding the complexity of the underlying OSGi-compatible registry system.</p>
17+
* while hiding the complexity of the underlying loader registry system.</p>
1818
*
1919
* <p><strong>Usage Examples:</strong></p>
2020
* <pre>{@code

server/java/core-spring/src/test/java/com/metaobjects/spring/MetaDataSpringIntegrationTest.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ public void setUp() {
9898

9999
@Test
100100
public void testMetaDataLoaderRegistryConfiguration() {
101-
// Verify registry is configured with OSGi-compatible service registry
101+
// Verify registry is configured with the service registry
102102
assertNotNull("MetaDataLoaderRegistry should be configured", metaDataLoaderRegistry);
103103

104104
// Verify test loader was auto-discovered and registered
@@ -200,13 +200,11 @@ public void testAdvancedRegistryAccess() {
200200
@Test
201201
public void testServiceRegistryFactoryIntegration() {
202202
// Verify that the auto-configuration uses ServiceRegistryFactory
203-
// This ensures OSGi compatibility
204-
assertNotNull("Registry should be configured with ServiceRegistryFactory",
203+
assertNotNull("Registry should be configured with ServiceRegistryFactory",
205204
ServiceRegistryFactory.getDefault());
206-
205+
207206
// The MetaDataLoaderRegistry should be using the default service registry
208-
// which auto-detects OSGi vs non-OSGi environments
209207
Collection<MetaDataLoader> loaders = metaDataLoaderRegistry.getDataLoaders();
210-
assertNotNull("Loaders should be accessible via OSGi-compatible registry", loaders);
208+
assertNotNull("Loaders should be accessible via the loader registry", loaders);
211209
}
212210
}

0 commit comments

Comments
 (0)