Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
a780592
Bump org.ehcache:ehcache from 3.10.8 to 3.11.1
dependabot[bot] Oct 1, 2025
d54bf5d
Bump com.gradleup.shadow from 9.0.0-beta17 to 9.2.2
dependabot[bot] Oct 1, 2025
fa81b98
Bump com.diffplug.spotless from 7.2.1 to 8.0.0
dependabot[bot] Oct 1, 2025
3885fb9
Bump actions/download-artifact from 5 to 6
dependabot[bot] Nov 1, 2025
7776df8
Bump stefanzweifel/git-auto-commit-action from 6 to 7
dependabot[bot] Nov 1, 2025
201c135
Bump org.junit.jupiter:junit-jupiter from 5.+ to 6.0.1
dependabot[bot] Nov 1, 2025
f1cb48b
Bump actions/upload-artifact from 4 to 5
dependabot[bot] Nov 1, 2025
62b170f
Version bump
Nov 4, 2025
626c492
Merge pull request #23 from ortus-boxlang/dependabot/gradle/org.ehcac…
jclausen Nov 5, 2025
7d8d2e1
Merge pull request #25 from ortus-boxlang/dependabot/gradle/com.gradl…
jclausen Nov 5, 2025
710e3f7
Merge pull request #26 from ortus-boxlang/dependabot/gradle/com.diffp…
jclausen Nov 5, 2025
a3c0287
Merge pull request #31 from ortus-boxlang/dependabot/github_actions/a…
jclausen Nov 5, 2025
6550ad2
Merge pull request #32 from ortus-boxlang/dependabot/github_actions/s…
jclausen Nov 5, 2025
45fb65c
Merge pull request #33 from ortus-boxlang/dependabot/gradle/org.junit…
jclausen Nov 5, 2025
4fd3aba
Merge pull request #34 from ortus-boxlang/dependabot/github_actions/a…
jclausen Nov 5, 2025
8f87f92
update for shadowJar compat
jclausen Nov 5, 2025
6e96902
fix gradle version
jclausen Nov 5, 2025
62b023e
fix hibernate version substitution
jclausen Nov 5, 2025
b11cb29
Update context handling to support thread context
michaelborn Oct 13, 2025
6a190bf
Rename ORMRequestContext -> ORMContext
michaelborn Oct 13, 2025
2170538
Update changelog for BLMODULES-102
michaelborn Oct 13, 2025
139c705
Update JDBC context search per BradGPT suggestions
michaelborn Nov 8, 2025
ac94882
More renaming from ORMRequestContext -> ORMContext
michaelborn Nov 8, 2025
b39aa0a
Tweak ORM context logging on request startup/shutdown
michaelborn Nov 10, 2025
306cfa7
Merge branch 'development' into patch/orm-in-threads-support
michaelborn Nov 10, 2025
37f796d
Documentation tweaks per Copilot
michaelborn Nov 24, 2025
1b63d3e
Merge pull request #30 from ortus-boxlang/patch/orm-in-threads-support
michaelborn Nov 24, 2025
d0f1647
Add copilot instructions
michaelborn Nov 24, 2025
f15ddbf
Update changelog for BLMODULES-102.
michaelborn Nov 24, 2025
dca9623
Drop incomplete/unnecessary docs
michaelborn Nov 24, 2025
428bd5b
Tweak copilot instructions
michaelborn Nov 24, 2025
ea36e71
Tweak gitignore
michaelborn Nov 24, 2025
4cc7e1d
Ensure we use nearest JDBC context for full concurrency support
michaelborn Nov 25, 2025
c02cbeb
Fix incorrect usage of request context in BIFs
michaelborn Nov 26, 2025
ec5a1e0
Bump actions/checkout from 5 to 6
dependabot[bot] Dec 1, 2025
954341e
Bump io.boxlang:boxlang from 1.6.0 to 1.7.0
dependabot[bot] Dec 1, 2025
47ff7da
Bump com.diffplug.spotless from 8.0.0 to 8.1.0
dependabot[bot] Dec 1, 2025
1339d69
Merge pull request #38 from ortus-boxlang/dependabot/gradle/com.diffp…
jclausen Dec 1, 2025
b69aa26
Merge pull request #36 from ortus-boxlang/dependabot/github_actions/a…
jclausen Dec 1, 2025
7bbf45c
Merge pull request #37 from ortus-boxlang/dependabot/gradle/io.boxlan…
jclausen Dec 1, 2025
15ab92c
remove removed runtime methods, update to return BoxProxy to fix fail…
jclausen Dec 1, 2025
b6bfb5f
add test for null value in entityLoad criteria
jclausen Dec 5, 2025
75d3ad5
fix version
jclausen Dec 5, 2025
f0a4712
Merge branch 'main' into development
jclausen Dec 5, 2025
b3663b7
BLMODULES-109 Resolve
jclausen Dec 5, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup Java
uses: actions/setup-java@v5
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
issues: write
steps:
- name: Checkout Repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup CommandBox
uses: Ortus-Solutions/setup-commandbox@v2.0.1
Expand Down Expand Up @@ -115,7 +115,7 @@ jobs:

- name: Upload Build Artifacts
if: success()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: boxlang-build
path: |
Expand Down Expand Up @@ -188,12 +188,12 @@ jobs:
issues: write
steps:
- name: Checkout Development Repository
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
ref: development

- name: Download build artifacts
uses: actions/download-artifact@v5
uses: actions/download-artifact@v6
with:
name: boxlang-build
path: .tmp
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:
contents: write
checks: write
steps:
- uses: actions/checkout@v5
- uses: actions/checkout@v6

- name: Setup Java
uses: actions/setup-java@v5
Expand All @@ -50,7 +50,7 @@ jobs:
./gradlew spotlessApply --stacktrace

- name: Commit Format Changes
uses: stefanzweifel/git-auto-commit-action@v6
uses: stefanzweifel/git-auto-commit-action@v7
with:
commit_message: Apply cfformat changes

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:

env:
MODULE_ID: ${{ github.event.repository.name }}
GRADLE_VERSION: 8.7
GRADLE_VERSION: 8.14.1

jobs:
tests:
Expand All @@ -35,7 +35,7 @@ jobs:
# experimental: true
steps:
- name: Checkout Repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup Java
uses: actions/setup-java@v5
Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:

- name: Upload Test Results
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: tests-${{ matrix.os }}-${{ matrix.jdkVersion }}
path: |
Expand Down Expand Up @@ -110,7 +110,7 @@ jobs:
issues: read
steps:
- name: Download Artifacts
uses: actions/download-artifact@v5
uses: actions/download-artifact@v6
with:
path: artifacts

Expand Down
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
.gradle
build/**
build/
bin/
test/
!gradle/wrapper/gradle-wrapper.jar

# Secrets
Expand All @@ -23,7 +24,8 @@ derby.log
src/test/resources/libs/*
!src/test/resources/libs/.gitkeep
src/test/resources/modules/
grapher/**
grapher/
boxlang_modules/

## HBXML Files
src/test/resources/app/models/**/*.hbm*
44 changes: 44 additions & 0 deletions COPILOT_INSTRUCTIONS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# Copilot Instruction File for bx-orm

## High-Level Purpose

The `bx-orm` module provides Object-Relational Mapping (ORM) capabilities for the BoxLang and boxlang JVM language. It enables developers to map BoxLang objects to relational database tables, manage database schema, and perform CRUD operations using a high-level, object-oriented approach. The module abstracts database interactions, allowing for more maintainable and database-agnostic application code.

bx-orm sits as a middleware between the boxlang dynamic JVM language and Hibernate ORM. It abstracts not only database operations, but the verbose Hibernate configuration syntax.

Due to issues with JPA requiring native java classes in entity configuration, bx-orm utilizes Hibernate 5.6.15-FINAL which enables dynamic java classes in place of Java source files. Hence all Hibernate integration code is written against Hibernate 5, not Hibernate 6 or 7.

## Module Structure and Design

- src/main/bx/**: Contains BoxLang source files, including the module settings file `ModuleConfig.bx` and boxlang interfaces for event handling, naming strategies, etc.
- src/main/java/**: Java implementation of the ORM engine
- src/main/java/ortus/boxlang/modules/orm/bifs/**: Built-in functions for interacting with ORM entities or the ORM session.
- src/main/java/ortus/boxlang/modules/orm/config/**: Hibernate configuration-related files, such as the event handler, connection provider, naming strategies, and base Hibernate configuration wrapper.
- src/main/java/ortus/boxlang/modules/orm/hibernate/**: Houses hibernate interface implemenations for value casters (converters), the hibernate cache, and especially box class to hibernate entity proxy objects.
- src/main/java/ortus/boxlang/modules/orm/mapping/**: Houses classes that assist in parsing boxlang ORM entities into ORM context/state and generating hibernate HBM.xml configuration files
- src/main/test/java/ortus/**: Junit tests
- src/main/test/java/ortus/tools/**: Base test files and util classes for assistance in writing junit tests
- src/main/test/resources/app/**: Test boxlang files for a test app. Includes ORM models, ORM configuration in Application.bx, and other boxlang test files.
- src/main/resources/**: Resource files such as configuration, metadata, and licensing.
- build/**: Build artifacts, generated sources, and documentation.
- bin/**: Packaged module binaries and metadata for distribution.

## Design Principles

- **Separation of Concerns**: Java code handles low-level ORM logic, while BoxLang code provides configuration and high-level integration.
- **Extensibility**: The module supports custom naming strategies, event handlers, and database dialects.
- **Testability**: Includes comprehensive test cases and seed data to ensure reliability across different environments.
- **Documentation**: Extensive documentation and examples are provided to help users understand and extend the module.

## Usage Guidance for Copilot
- Follow the established directory structure when adding new features.
- Prefer extending existing interfaces and base classes for new ORM features.
- Ensure new code is covered by tests in the `src/main/test/java/ortus/` directory.
- Ensure new features, bug fixes, security updates, etc. are added to `changelog.md` under `## [Unreleased]`.

## Tooling

* Gradle is used for building/compiling the java sources, running junit tests, and building the final boxlang module structure into a zip file for uploading to forgebox.io.
* Hibernate 5.6.15-FINAL serves as the ORM engine under the hood.
* Spotless is used for java source formatting.
* Docker-compose is used to stand up a simple mysql database for integration testing.
26 changes: 13 additions & 13 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
plugins {
id 'java'
// For source code formatting
id "com.diffplug.spotless" version "7.2.1"
id "com.diffplug.spotless" version "8.1.0"
// https://github.com/harbby/gradle-serviceloader
id "com.github.harbby.gradle.serviceloader" version "1.1.9"
// Shadow
id "com.gradleup.shadow" version "9.0.0-beta17"
id "com.gradleup.shadow" version "9.2.2"
// Download task
id "de.undercouch.download" version "5.6.0"
}
Expand Down Expand Up @@ -42,8 +42,8 @@ dependencies {
compileOnly files( '../../boxlang/build/libs/boxlang-' + boxlangVersion + '.jar' )
testImplementation files( '../../boxlang/build/libs/boxlang-' + boxlangVersion + '.jar' )
} else {
compileOnly "io.boxlang:boxlang:1.6.0"
testImplementation "io.boxlang:boxlang:1.6.0"
compileOnly "io.boxlang:boxlang:1.7.0"
testImplementation "io.boxlang:boxlang:1.7.0"
}

// Implementation Dependencies
Expand All @@ -54,11 +54,11 @@ dependencies {
// https://mvnrepository.com/artifact/javax.cache/cache-api
implementation 'javax.cache:cache-api:1.1.1'
// https://mvnrepository.com/artifact/org.ehcache/ehcache
implementation 'org.ehcache:ehcache:3.10.8'
implementation 'org.ehcache:ehcache:3.11.1'

// Testing Dependencies
// Pinning this because the next version up breaks our tests
testImplementation "org.junit.jupiter:junit-jupiter:5.+"
testImplementation "org.junit.jupiter:junit-jupiter:6.+"
testImplementation "org.mockito:mockito-core:5.+"
testImplementation "com.google.truth:truth:1.+"
// Explicitly declare the JUnit platform launcher (to avoid deprecation)
Expand Down Expand Up @@ -152,7 +152,6 @@ shadowJar {
mergeServiceFiles()
destinationDirectory = file( "build/libs" )
}
build.finalizedBy( shadowJar )

/**
* Source Code Formatting
Expand All @@ -174,31 +173,32 @@ spotless {
* - Copies the src/main/bx/** to build/module/ folder.
*/
task createModuleStructure(type: Copy) {
mustRunAfter shadowJar, jar
from( 'build/libs' ) {
include "${project.name}-${version}.jar"
into 'libs'
}
from( 'src/main/bx' ) {
include '**/*.bx'
// Token Replacements Go Here
filter { line -> line.replaceAll('@build.version@', project.version) }
filter { line -> line.replaceAll('@build.hibernateVersion@', hibernateVersion) }
filter{ line -> line.replaceAll( '@build.version@', project.version ) }
if( project.branch == "development" ){
filter { line -> line.replaceAll( '\\+@build.number@', '' ) }
filter{ line -> line.replaceAll( '\\+@build.number@', '' ) }
} else {
filter { line -> line.replaceAll( '@build.number@', project.buildID ) }
filter{ line -> line.replaceAll( '@build.number@', project.buildID ) }
}
}
from( '.' ) {
include 'box.json'
include 'readme.md'
include 'changelog.md'
// Token Replacements Go Here
filter { line -> line.replaceAll( '@build.version@', project.version ) }
filter{ line -> line.replaceAll( '@build.version@', project.version ) }
if( project.branch == "development" ){
filter { line -> line.replaceAll( '\\+@build.number@', '' ) }
filter{ line -> line.replaceAll( '\\+@build.number@', '' ) }
} else {
filter { line -> line.replaceAll( '@build.number@', project.buildID ) }
filter{ line -> line.replaceAll( '@build.number@', project.buildID ) }
}
}

Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- [BLMODULES-102](https://ortussolutions.atlassian.net/browse/BLMODULES-102) - Fix ORM usage in threads causing ConcurrentModificationException

## [1.1.3] - 2025-11-04

### 🐛 Fixed
Expand Down
37 changes: 0 additions & 37 deletions docs/Configuration.md

This file was deleted.

98 changes: 0 additions & 98 deletions docs/Events.md

This file was deleted.

Loading
Loading