Created
August 26, 2012 12:45
-
-
Save joeRinehart/3478702 to your computer and use it in GitHub Desktop.
CustomMapping
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package recordstore | |
class Thing { | |
static mapping = { | |
version false | |
autoTimestamp false | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package recordstore | |
class Thing { | |
static mapping = { | |
// Turn off Grails features | |
version false | |
autoTimestamp false | |
// Change the table name | |
table 'tbl_thing' | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package recordstore | |
class Thing { | |
// New property: thingName | |
String thingName | |
static mapping = { | |
// Turn off Grails features | |
version false | |
autoTimestamp false | |
// Change the table name | |
table 'tbl_thing' | |
// 'thingName' should be 'thingName', not 'thing_name' | |
thingName column: 'thing_name' | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package recordstore | |
class Thing { | |
// New property: thingName | |
String thingName | |
String massiveTextField | |
static mapping = { | |
// Turn off Grails features | |
version false | |
autoTimestamp false | |
// Change the table name | |
table 'tbl_thing' | |
// 'thingName' should be 'thingName', not 'thing_name' | |
thingName column: 'thing_name' | |
// massiveTextField should be whatever Hibernate says 'text' is on MySql | |
massiveTextField type: 'text' | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package recordstore | |
class Thing { | |
// New property: thingName | |
String thingName | |
String massiveTextField | |
static mapping = { | |
// Turn off Grails features | |
version false | |
autoTimestamp false | |
// Change the table name | |
table 'tbl_thing' | |
// 'thingName' should be 'thingName', not 'thing_name' | |
thingName column: 'thing_name' | |
// massiveTextField should by a MySql longtext field | |
massiveTextField sqlType: 'longtext' | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package recordstore | |
class Thing { | |
// Many 'Thing' to one 'OtherThing': means 'thing' | |
// has a foreign key | |
OtherThing otherThing | |
static mapping = { | |
otherThing column: 'otherThingId' | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment