I have below grails config: Datasource. environments { development { dataSource { dbCreate = "create-drop" // one of 'create', 'create-drop', 'update', 'validate', '' url = "jdbc:h2:mem:devDb;MVCC=TRUE;LOCK_TIMEOUT=10000;DB_CLOSE_ON_EXIT=FA
I have the following problem in Domain class model. I have a BaseDomainClass. Which i use like this: class ScheduleAction extends BaseDomainClass{ ... static mapping = { tablePerHierarchy false } } this works fine. All the properties from by BaseDoma
I am using a Domain Class as a rest resource as mentioned in Grails documentation So while using this approach there are no controllers or service classes created. And I tried to find a way to write Integration tests for the Domain as a REST resource
I am trying to write formula in my domain class which helps me in creating criteria. Class MyClass { //some fields Date appointmentTime String ddmmyy int year int month int day static transients = ['ddmmyy', 'year', 'month', 'day'] static mapping= {
I have some methods that are common across a few of my domain classes. I want to reduce the amount of replicated code and two solutions came to mind: 1) Put the common methods in a baseDomain class and inherit the methods from it in my domains 2) Put
I'm a grails newbie working on a project for fun. I'm serializing a class like this: def msg = (listing as XML).toString() the trying to deserialize a class using the XMLSlurper like this: def root = new XmlSlurper().parseText(listingString) def sell
In grails is creating a new domain class and never persisting any objects to the db, the best way to create a class that you don't want to store in the db? --------------Solutions------------- define static mapWith="none" inside your class in grails-
I have a domain constraint which I am validating like userName(blank:false, nullable:false, Size: 5..50,matches:'^[A-Za-z\\d]*$',validator:{chkUser,user->if(user.loginService.getUser(user.organizationId,user.userName)!=null){ return[propertyName="
I would like to use the .list call with another query (for example a date range or all of a certain type). Is this possible or do I need to build a custom .find call wrapping all the options in .list like offset and max? --------------Solutions------
I've got a simple bi-directional one-to-many mapping, as follows, with a default sort order specified on the owning side. However, the sort order doesn't seem to be getting applied? I'm using Grails v2.0.1 (I've now replicated this example with v1.3.
I have the following setup. Class, say, Car that has a CarPart (belongsTo=[car:Car]). When I'm creating a Car I also want to create som default CarParts, so I do def car = new Car(bla bla bla) def part = new CarPart(car:car) Now, when I do car.valida
The output of my test gives com.example.book.Book : null. When I debug the test, b object is created with "MyBook" as its name. But since its has a static mapping belongsTo, the test fails. How do I make this work. When I comment the belongsTo mappin
I'm using Grails 1.3.7 and the db-migration plug-in. I have generated a chagelog.groovy-file containing my delta, I set theese properties: grails.plugin.databasemigration.updateOnStart = true grails.plugin.databasemigration.updateOnStartFileNames = [
Created a domain class, Student. Created a controller, in controller called def p = new Student() p.save() It says No signature of method: hazelgrails.Student.save() is applicable for argument types: () values: [] Possible solutions: save(), save(boo
I'm new to grails and trying to write unit tests for Service class has the method, it calls criteria on domain object. How do you mock the domain behavior in the following method of a service class? {def checkForDuplicates(firstName, lastName, gender
I need to log data changes from the table "documents" into another table "documents_log" using Grails. Is there an easy way to do this? I read about Audit Logging, but the documentation is poor and it logs in the same table, right? Any suggestions? -
Possible Duplicate: Spring + Hibernate : a different object with the same identifier value was already associated with the session I have three domains arranged similar to the example below: class Computer { static hasMany = [progStartTimes:ProgStart
I am working with the Grails Authentication plugin and trying to add a domain class from the plugin into my GORM. I am able to use plugin objects in my application when importing them with, "import com.grailsrocks.authentication.AuthenticationUser",
I'm trying to save a large grails domain object structure, where the number of domain classes is a handful, but the number of objects around a hundred. The objects are linked using classic grails hasMany. The basic idea is to wipe the database first
People, I'm facing a problem with grails GORM, my Application is totally dependent of the DomainClass.list() method, it is in all of my create/edit GSPs, but now I need a particular behavior for listing objects. Being more specific I need to filter t