grails-domain-class Questions

1

Solved

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 trans...

1

Solved

I have 2 tables in grails with mysql say A and B The scenarios that I want to implement here are : (1)instance of A can have zero / one / more than one instance of B. (2)when instance A is dele...
Synthesis asked 8/5, 2014 at 8:27

3

Solved

In my Grails domain class I want to set default values which do persist in the database. I use mysql as database. I tried to do this: class A { long someValue = 1 long someOtherValue boolean s...
Claudetteclaudia asked 12/5, 2013 at 9:30

3

I had a LocalTime field (using Joda Time) in Grails domain class. Class WorkDone{ LocalTime duration } Now I have altered this field to String (with Text constraint) so that it can support dura...

3

I have a parent domain class the has a hasMany of another domain class. Both the parent and the child domain classes have the lastUpdated and the dateCreated fields. My issue is that when I update ...
Jegar asked 26/6, 2012 at 16:1

2

Solved

I want to make a copy of a domain object. What is the simplest way to accomplish this? I realize I could create a new record, and then iterate over each of the fields copying the data field-by-fie...
Cristalcristate asked 12/7, 2013 at 12:20

2

Solved

When using command objects like: class UserCommand { String name static constraints = { name blank: false, unique: true, minSize: 3 } } you can use them to validate objects without making...

2

Solved

I have a form to create a place. Depending of the country, the province (state, region) field is required or not. When is not required, I want to be null, not empty string. I have code that makes ...
Muenster asked 29/5, 2012 at 8:21

2

Solved

I am new to Grails. I have a Person domain class as : class Person { String firstName String lastName String gender Date dateOfBirth } And wondering if I can define possible values for a pr...
Kamala asked 8/7, 2012 at 4:46

2

Solved

After migrating from Grails 1.3.7 to 2.0.4 I have noticed a problem with one of my domain classes where I use transient properties in order to handle passwords. My domain class looks like this (si...
Unwonted asked 2/7, 2012 at 16:14

1

Solved

Given the following Grails Domain Classes, how do I go about renaming the displayed field name for isbn to be "ISBN" (as opposed to the default "Isbn") and authors to be "Author(s)" (as opposed to ...
Zapateado asked 22/6, 2012 at 22:29

3

Solved

Imagine two Grails applications which share a domain class. Maybe a Book domain class. One application is identified as the owner of the data, one will have to access the domain data. Something li...
Nyx asked 16/5, 2012 at 7:41

1

Solved

I have 2 objects, ObjectA and ObjectB. When ObjectA gets created, ObjectB doesn't (and can't, due to not having the data yet) exist yet. Once ObjectB is created, it needs to have a corresponding ...
Wafture asked 21/2, 2012 at 18:37

2

Solved

In grails, I can implement an N:1 relationship like this: class Parent { hasMany = [children:Child] } class Child { belongsTo = [parent:Parent] } Now (if addTo and removeFrom is always properly ...
Allgood asked 29/6, 2010 at 14:59

1

Solved

Suppose a simple Grails domain class: class Account { String countryId; String userName; String password; static constraints = { ...???... } } It is required that user names are unique ...

0

In Grails 1.3.7 I've spent quite some time to convert my domain class relations according to Burt's suggestions in http://www.infoq.com/presentations/GORM-Performance Now, Grails 2 supports ...

3

Solved

I have a Groovy/Grails website that is being used to send data to Android clients via JSON. I have created both the Android client and the Groovy/Grails website; and they can output the same object...

1

Solved

I have two domains that are a part of a one-to-many relations ship. I was wondering how i can query the child for the parents FK? bellow is the psuedo-code for parent/child Parent: class AlumPro...
Impersonal asked 5/8, 2011 at 16:43

1

Solved

I want to allow users to traverse the domain classes and print out dumps of stuff. My frist problem: assuming the following works just fine: //this works class EasyStuffController{ def quickStuff...
Thelma asked 14/6, 2011 at 1:25

2

Solved

Hello I have the follwing domain classes. class Student { int age static hasMany = [courses:Course] } class Course { String name static hasMany = [students:Student] } I want to find the Stu...
Waldman asked 11/6, 2011 at 15:29

2

I'm trying to set default sort of my hasMany attribute using mapping statement. I'm following the grails doc but it doesn't work for me (grails 1.3.5). My code looks like: class Note { Calendar s...
Nephelinite asked 12/11, 2010 at 12:57

2

Where should I place a transient domain class in a grails app? Ie I have an Action class that will be passed about, and used, but never saved. Should this be in the grails-app/domain folder, or s...
Messene asked 19/2, 2011 at 15:46

1

Solved

I am a newbie in grails and groovy. I have a Project domain-class with start and end date. I want to put in a constraint specifying that the end date needs to be greater than the start date(and the...
Harrisharrisburg asked 2/11, 2010 at 18:58

1

Solved

I'm using the Grails Webflow plugin. Here are the domain objects I'm working with: class Foo implements Serializable { String fooProp1, fooProp2 static constraints = { fooProp2 nullable: fals...
Aminopyrine asked 26/10, 2010 at 12:50

2

Solved

For now I have field "String firstName" it converted to "first_name" and i want "firstname" as default in Hibernate. Is it posible?
Pedant asked 14/9, 2010 at 13:37

© 2022 - 2024 — McMap. All rights reserved.