Skip to content

Instantly share code, notes, and snippets.

@robi42
Created April 11, 2010 17:15
Show Gist options
  • Save robi42/362892 to your computer and use it in GitHub Desktop.
Save robi42/362892 to your computer and use it in GitHub Desktop.
Index: src/org/ringojs/wrappers/Storable.java
===================================================================
--- src/org/ringojs/wrappers/Storable.java (revision 8afdca5b125784a121643a029b843cec33577e64)
+++ src/org/ringojs/wrappers/Storable.java Sun Apr 11 19:10:01 CEST 2010
@@ -85,7 +85,7 @@
}
@JSStaticFunction
- public static Scriptable defineClass(Scriptable store, String type, Object mapping)
+ public static Scriptable defineClass(Scriptable store, String type, Object mapping, Object settings)
throws NoSuchMethodException {
int attr = DONTENUM | PERMANENT | READONLY;
Scriptable scope = ScriptRuntime.getTopCallScope(Context.getCurrentContext());
@@ -102,6 +102,8 @@
if (mapping != Undefined.instance) {
ctor.defineProperty("mapping", mapping, attr);
factory.defineProperty("mapping", mapping, attr);
+ ctor.defineProperty("settings", settings, attr);
+ factory.defineProperty("settings", settings, attr);
}
return ctor;
}
@robi42
Copy link
Author

robi42 commented Apr 11, 2010

Sketch enabling hib storage impl to define additional "entity-level settings", like:

store.defineClass('Person', mappingObj, {table: 'persons', cacheable: false});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment