daily pastebin goal
50%
SHARE
TWEET

Untitled

a guest Aug 17th, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Assigned domain class id wierdness with Grails
  2. //in bootstrap
  3. def it1 = new ItemType(id:4,name:'feature')
  4. it1.save()
  5. //domanin class
  6. class ItemType {
  7.     String name
  8.     int id
  9.  
  10.     static constraints = {
  11.         id(unique:true,blank:false)
  12.         name(blank:false)
  13.     }
  14.  
  15.     static mapping = {
  16.         id column: 'ItemTypeId', generator:'assigned'
  17.         name column: 'Name'
  18.         version false
  19.     }
  20. }
  21.    
  22. //in bootstrap
  23. def it1 = new ItemType(name:'feature')
  24. it1.id=4
  25. it1.save()
  26. //domanin class
  27. class ItemType {
  28.     String name
  29.     //int id
  30.  
  31.     static constraints = {
  32.         id(unique:true,blank:false)
  33.         name(blank:false)
  34.     }
  35.  
  36.     static mapping = {
  37.         id column: 'ItemTypeId', generator:'assigned'
  38.         name column: 'Name'
  39.         version false
  40.     }
  41. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top