Skip to content

Instantly share code, notes, and snippets.

@robi42
Created April 11, 2010 18:56
Show Gist options
  • Save robi42/362973 to your computer and use it in GitHub Desktop.
Save robi42/362973 to your computer and use it in GitHub Desktop.
var Person = require('ringo/storage/hibernate').defineClass('Person', {
table: 'persons', cacheable: false, props: {
firstName: {type: 'string', nullable: false},
lastName: {type: 'string', nullable: false},
birthDate: {type: 'timestamp', nullable: false},
birthYear: {type: 'integer'},
vitae: {column: 'resume', type: 'text', unique: true}
}});
@hns
Copy link

hns commented Apr 11, 2010

I find it easier to read formatted this way:

var Person = require('ringo/storage/hibernate').defineClass('Person', {
    table: 'persons', 
    cacheable: false, 
    props: {
        firstName: {type: 'string', nullable: false},
        lastName: {type: 'string', nullable: false},
        birthDate: {type: 'timestamp', nullable: false},
        birthYear: {type: 'integer'},
        vitae: {column: 'resume', type: 'text', unique: true}
    }
});

@robi42
Copy link
Author

robi42 commented Apr 11, 2010

I agree, updated package test & ringowiki/hibernate code as well as ringojs.org storage wiki page accordingly (BTW, also settled with properties instead of props, exclusively, now :) ).

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