The TekUser Domain Class

Some databases consider User to be a reserved word, so we’ll call our class TekUser. (Kind of catchy, huh?) Our TekUser class diagram looks like this:

images/TekUser.png

To create this class, we’ll run the create-domain-class script like so:

 
$ ​grails create-domain-class com.tekdays.TekUser

Now open TekDays/grails-app/domain/com/tekdays/TekUser.groovy, and edit it to look like this:

model.0.2/TekDays/grails-app/domain/com/tekdays/TekUser.groovy
 
package​ com.tekdays
 
 
class​ TekUser {
 
String​ fullName
 
String​ userName
 
String​ password
 
String​ email
 
String​ website
 
String​ bio
 
 
String​ toString() { fullName ...

Get Grails 2: A Quick-Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.