grails - How to set my computerId into primary key? -
here's code in domain. wanted set computerid primary key. still display on table(index). thanks
package com.data class computerinformation { string computerid; string computername; string status; string location; string serial; string monitorserial; string keyboardserial; string mouseserial; string cpuserial; string avrserial; string harddiskserial; static constraints = { computerid(unique:true) computername(blank:false) status(blank:false) location(blank:false) serial(blank:false) monitorserial(blank:false) keyboardserial(blank:false) mouseserial(blank:false) cpuserial(blank:false) avrserial(blank:false) harddiskserial(blank:false) } }
use this,
static mapping = { id name: 'computerid' }
Comments
Post a Comment