Advertisement
Guest User

Untitled

a guest
Feb 26th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. DataSource.groovy
  2. dataSource {
  3. pooled = true
  4. jmxExport = true
  5.  
  6. driverClassName = "oracle.jdbc.OracleDriver"
  7. username = "hr"
  8. password = "Destiny"
  9. }
  10. hibernate {
  11. cache.use_second_level_cache = true
  12. cache.use_query_cache = false
  13. // cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3
  14. cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4
  15. singleSession = true // configure OSIV singleSession mode
  16. flush.mode = 'manual' // OSIV session flush mode outside of transactional context
  17. }
  18.  
  19. // environment specific settings
  20. environments {
  21. development {
  22. dataSource {
  23. dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
  24. url = "jdbc:oracle:thin:@localhost:1524:orcldata"
  25. }
  26. }
  27. test {
  28. dataSource {
  29. dbCreate = "update"
  30. url = "jdbc:oracle:thin:@localhost:1524:orcldata"
  31. }
  32. }
  33. }
  34. *************************************
  35. portfolio.groovy
  36. package all
  37.  
  38. class Portfolio {
  39. int classid
  40. String classname
  41. int capacity
  42.  
  43. static constraints = {
  44.  
  45. classid()
  46. classname()
  47. capacity()
  48. }
  49. static mapping ={
  50. table : 'class'
  51.  
  52. version false
  53. columns{
  54. classid column:'classid'
  55. classname column:'classname'
  56. capacity column:'capacity'
  57. }
  58.  
  59.  
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement