diff --git a/docs/src/SUMMARY.md b/docs/src/SUMMARY.md index b6412fc2d..3fd139cb6 100644 --- a/docs/src/SUMMARY.md +++ b/docs/src/SUMMARY.md @@ -113,6 +113,7 @@ * [Switching Environments](working-with-wheels/switching-environments.md) * [Testing Your Application](working-with-wheels/testing-your-application.md) * [Using the Test Environment](working-with-wheels/using-the-test-environment.md) +* [Overriding Core Methods](working-with-wheels/overriding-core-methods.md) * [Contributing to Wheels](working-with-wheels/contributing-to-wheels.md) * [Contributing to Wheels VS Code Extension](working-with-wheels/contributing-to-wheels-vscode-extension.md) * [Contributing to Wheels Windows Installer](working-with-wheels/contributing-to-wheels-windows-installer.md) diff --git a/docs/src/database-interaction-through-models/using-sqlite.md b/docs/src/database-interaction-through-models/using-sqlite.md index 2b475b628..b527016c1 100644 --- a/docs/src/database-interaction-through-models/using-sqlite.md +++ b/docs/src/database-interaction-through-models/using-sqlite.md @@ -42,20 +42,22 @@ SQLite is different from traditional client-server databases like MySQL, Postgre SQLite support is built into most CFML engines, but you may need to add the JDBC driver: -#### Lucee +#### Lucee and Adobe ColdFusion -Lucee includes SQLite support by default. No additional installation needed. - -#### Adobe ColdFusion - -Download the SQLite JDBC driver from [GitHub](https://github.com/xerial/sqlite-jdbc/releases) and place it in your ColdFusion classpath: +Download the SQLite JDBC driver from [GitHub](https://github.com/xerial/sqlite-jdbc/releases) and place it in your server classpath: ```bash -# Copy the JAR to ColdFusion's lib directory +# Copy the JAR to server's lib directory cp sqlite-jdbc-3.50.3.0.jar /path/to/coldfusion/lib/ ``` -Restart ColdFusion after adding the driver. +Restart the server after adding the driver. + +{% hint style="info" %} +**Note for Adobe ColdFusion 2018:** +Adobe ColdFusion 2018 already ships with a SQLite JDBC driver in its classpath, but this bundled version is outdated and may cause compatibility issues. +To use a newer SQLite version, you should remove the existing SQLite JAR from the ColdFusion classpath and replace it with the latest driver downloaded from GitHub, then restart the server. +{% endhint %} #### Boxlang diff --git a/docs/src/working-with-wheels/overriding-core-methods.md b/docs/src/working-with-wheels/overriding-core-methods.md new file mode 100644 index 000000000..95a8fae9c --- /dev/null +++ b/docs/src/working-with-wheels/overriding-core-methods.md @@ -0,0 +1,98 @@ +## Overriding Core Wheels Methods (Wheels 3.x) + +In Wheels 2.5, developers could override core framework methods (such as `findAll`) in their models and call the original Wheels implementation using the `super` scope. + +Due to internal framework restructuring in Wheels 3.0, this behavior no longer works using the traditional `super.methodName()` syntax. To restore this capability in a predictable and explicit way, Wheels now provides a new **`super`-prefixed method convention**. + +--- + +### Wheels 2.5 Behavior + +In Wheels 2.5, overriding a core model method and calling the original implementation looked like this: + +```javascript +component extends="Model" { + + function findAll() { + // custom logic here + + return super.findAll(); + } + +} +``` + +This worked because Wheels core methods were directly accessible via the `super` scope. + +--- + +### Why This Changed in Wheels 3.0 + +Wheels 3.0 introduced a significant internal reorganization of the framework to support: + +- improved extensibility +- cleaner separation of concerns +- better compatibility with multiple runtimes + +As a result, calling core methods using `super.methodName()` is no longer reliable or supported in the same way. + +--- + +### New Approach in Wheels 3.0+ + +To override a core Wheels method and still call the original implementation, you now use a **`super`-prefixed method name**. + +Instead of calling: + +``` +super.findAll() +``` + +You call: + +``` +superFindAll() +``` + +--- + +### Example: Overriding `findAll()` + +```javascript +component extends="Model" { + + function findAll() { + // custom logic before calling Wheels core method + + return superFindAll(); + } + +} +``` + +This allows you to: + +- safely override any core Wheels method +- explicitly call the original Wheels implementation +- avoid framework internals or brittle inheritance behavior + +--- + +### Key Notes + +- The `superMethodName()` convention applies only when overriding a core Wheels method +- Method names are case-insensitive, following normal CFML rules +- This behavior is available in Wheels 3.x and later +- No changes are required for applications that do not override core methods + +--- + +### Migration Tip for Wheels 2.5 Applications + +If you are upgrading an application from Wheels 2.5 to 3.0+ and have overridden core methods: + +1. Search for usages of `super.methodName()` +2. Replace them with `superMethodName()` +3. Test overridden behavior to ensure expected results + +This small change restores the same extension capability that existed in Wheels 2.5, while remaining compatible with the updated framework architecture. \ No newline at end of file