Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- DataSource.groovy
- dataSource {
- pooled = true
- jmxExport = true
- driverClassName = "oracle.jdbc.OracleDriver"
- username = "hr"
- password = "Destiny"
- }
- hibernate {
- cache.use_second_level_cache = true
- cache.use_query_cache = false
- // cache.region.factory_class = 'net.sf.ehcache.hibernate.EhCacheRegionFactory' // Hibernate 3
- cache.region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' // Hibernate 4
- singleSession = true // configure OSIV singleSession mode
- flush.mode = 'manual' // OSIV session flush mode outside of transactional context
- }
- // environment specific settings
- environments {
- development {
- dataSource {
- dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', ''
- url = "jdbc:oracle:thin:@localhost:1524:orcldata"
- }
- }
- test {
- dataSource {
- dbCreate = "update"
- url = "jdbc:oracle:thin:@localhost:1524:orcldata"
- }
- }
- }
- *************************************
- portfolio.groovy
- package all
- class Portfolio {
- int classid
- String classname
- int capacity
- static constraints = {
- classid()
- classname()
- capacity()
- }
- static mapping ={
- table : 'class'
- version false
- columns{
- classid column:'classid'
- classname column:'classname'
- capacity column:'capacity'
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement