Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Aug 6th, 2012  |  syntax: None  |  size: 0.63 KB  |  hits: 18  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Employee not found with id null grails
  2. class Employee {
  3.  
  4.     Integer empId
  5.     String firstName
  6.     String lastName
  7.  
  8.     static constraints = {
  9.         empId()
  10.         firstName()
  11.         lastName()
  12.     }
  13.  
  14.     static mapping = {
  15.         id generator:'assigned', name:'empId'
  16.         version false
  17.     }
  18. }
  19.        
  20. static constraints = {
  21.     empId()
  22.     firstName()
  23.     lastName()
  24. }
  25.  
  26. static mapping = {
  27.     id generator:'assigned', name:'empId', column: 'emp_id'
  28.     version false
  29. }
  30.  
  31. public void setEmpId(Long empId){
  32.     this.empId = empId
  33.     this.id = empId
  34. }
  35.        
  36. id name: 'customId', generator: 'sequence', params: [sequence:'some_sequence']