Guest User

Untitled

a guest
Aug 16th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. How to change name of the foreign key used to map an association in Grails
  2. class AreaServer {
  3.  
  4.  
  5. String serverId
  6. ...
  7. ...
  8. static hasMany = [ serverProtocol : ServerProtocol ]
  9.  
  10. static mapping = {
  11. serverProtocol lazy:false
  12. id name: 'serverId', generator: 'assigned'
  13. serverProtocol column: 'server_serverId'
  14. }
  15.  
  16. class ServerProtocol {
  17.  
  18. long dbId
  19. ....
  20. ....
  21. static belongsTo = [ areaServer : AreaServer ]
  22.  
  23. static mapping = {
  24.  
  25. id name: 'dbId'
  26. version false
  27. }
Add Comment
Please, Sign In to add comment