Where to put def configClass = GrailsAnnotationConfiguration?

View: New views
3 Messages — Rating Filter:   Alert me  

Where to put def configClass = GrailsAnnotationConfiguration?

by Edderd :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I believe the line

def configClass = GrailsAnnotationConfiguration?

needs to go in my DataSource.groovy file, but where?

All the examples I see, show a snippet of code that looks like this:

xxxDataSource.groovy:
import org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration
class DevelopmentDataSource {
   def configClass = GrailsAnnotationConfiguration.class

...

my DataSource.groovy is straight from grails-1.1.1 and looks like this:

...
environments {
        development {
                dataSource {
                        dbCreate = "create-drop" // one of 'create', 'create-drop','update'
                        url = "jdbc:hsqldb:mem:devDB"
                }
        }
...

I tried putting the configClass in the dataSource closure, but that fails.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Parent Message unknown RE: Where to put def configClass = GrailsAnnotationConfiguration?

by Burt Beckwith :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Leave out the 'def' - it's configured like dbCreate, url, etc.

Burt

------

I believe the line

def configClass = GrailsAnnotationConfiguration?

needs to go in my DataSource.groovy file, but where?

All the examples I see, show a snippet of code that looks like this:

xxxDataSource.groovy:
import
org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration
class DevelopmentDataSource {
   def configClass = GrailsAnnotationConfiguration.class

...

my DataSource.groovy is straight from grails-1.1.1 and looks like this:

...
environments {
        development {
                dataSource {
                        dbCreate = "create-drop" // one of 'create', 'create-drop','update'
                        url = "jdbc:hsqldb:mem:devDB"
                }
        }
...

I tried putting the configClass in the dataSource closure, but that fails.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Where to put def configClass = GrailsAnnotationConfiguration?

by Edderd :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thanks Burt, and I just discovered this resource:

http://grails.org/Hibernate+Integration

Thanks again.

On Thu, Jul 2, 2009 at 2:13 PM, Burt Beckwith <burt@...> wrote:
Leave out the 'def' - it's configured like dbCreate, url, etc.

Burt

------

I believe the line

def configClass = GrailsAnnotationConfiguration?

needs to go in my DataSource.groovy file, but where?

All the examples I see, show a snippet of code that looks like this:

xxxDataSource.groovy:
import
org.codehaus.groovy.grails.orm.hibernate.cfg.GrailsAnnotationConfiguration
class DevelopmentDataSource {
  def configClass = GrailsAnnotationConfiguration.class

...

my DataSource.groovy is straight from grails-1.1.1 and looks like this:

...
environments {
       development {
               dataSource {
                       dbCreate = "create-drop" // one of 'create', 'create-drop','update'
                       url = "jdbc:hsqldb:mem:devDB"
               }
       }
...

I tried putting the configClass in the dataSource closure, but that fails.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email





--
- Ed