/
jshell
executable file
·39 lines (31 loc) · 1.08 KB
/
jshell
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/local/bin/node --harmony
var repl = require("./jrepl");
var server = repl.start();
var context = server.context;
// Configure what's available in the REPL
context.util = require("util");
context.jones = require("database-jones");
global.MySQLngDefaultConnectionProperties = new context.jones.ConnectionProperties('mysql');
global.t_basic = function(id, name, age, magic) {
if (typeof id !== 'undefined') this.id = id;
if (typeof name !== 'undefined') this.name = name;
if (typeof age !== 'undefined') this.age = age;
if (typeof magic !== 'undefined') this.magic = magic;
};
global.t_basic.prototype.getAge = function() {return this.age;};
/** The t_basic key */
global.t_basic_key = function(id) {
this.id = id;
};
/** The t_basic unique key */
global.t_basic_magic_key = function(id) {
this.magic = id;
};
//map t_basic domain object
context.tablemapping = new context.jones.TableMapping("test.t_basic")
.mapField("id")
.mapField("age")
.mapField("name")
.mapField("magic")
.applyToClass(global.t_basic)
context.openSession = context.jones.openSession;